starting to write the commit functions
This commit is contained in:
@@ -39,17 +39,20 @@ func (db *DB) CheckIfFileCurrentlyMonitored(path string) bool {
|
||||
if err := db.One("Path", path, &file); err != nil {
|
||||
if err.Error() != "not found" {
|
||||
db.Err(err).Msg("Error finding file by path")
|
||||
fmt.Printf("Not found: %s error: %s\n", path, err)
|
||||
return false
|
||||
}
|
||||
db.Warn().Msg("no file found")
|
||||
fmt.Printf("Not found: %s error: %s\n", path, err)
|
||||
return false
|
||||
}
|
||||
fmt.Printf("Found!: %s searched: %s\n", file.Path, path)
|
||||
return true
|
||||
}
|
||||
|
||||
// RetrieveWatchedFiles all files that are in the database as "watched files"
|
||||
// RetrieveTrackedFiles all files that are in the database as "watched files"
|
||||
// This can be used to trigger the same files to be watched again
|
||||
func (db *DB) RetrieveWatchedFiles() ([]File, error) {
|
||||
func (db *DB) RetrieveTrackedFiles() ([]File, error) {
|
||||
var files []File
|
||||
if err := db.All(&files); err != nil {
|
||||
db.Err(err).Msg("Error retrieving all watched files")
|
||||
|
Reference in New Issue
Block a user