feat: add new features such as database watchdog
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"log"
|
||||
"log/slog"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func watchdog(w string, db *gorm.DB) {
|
||||
slog.Info("performing the watchdog cycle")
|
||||
|
||||
files, err := GetFiles(db)
|
||||
if err != nil {
|
||||
slog.Error("failed to retrieve the files indexed from the database", "error", err)
|
||||
return
|
||||
}
|
||||
|
||||
log.Println(files)
|
||||
}
|
||||
Reference in New Issue
Block a user