adding path checks to manager
This commit is contained in:
@@ -22,12 +22,12 @@ type Event struct {
|
||||
// * copying any versions and keeping them safe (even if temporary)
|
||||
// * creating the diff of the file, in both directions if necessary
|
||||
// * storing the details in the database
|
||||
func NewWatcher(logger *zerolog.Logger, KEYFOLDER, DOWNLOADFOLDER, SYNCFOLDER, THUMBFOLDER, DIFFFOLDER string) (FileWatcher, error) {
|
||||
func NewWatcher(logger *zerolog.Logger, keyFolder, downloadFolder, syncFolder, thumbFolder, diffFolder string) (FileWatcher, error) {
|
||||
w := FileWatcher{
|
||||
watcher.New(),
|
||||
logger,
|
||||
true, //used to temporarily ignore events if necessary
|
||||
KEYFOLDER, DOWNLOADFOLDER, SYNCFOLDER, THUMBFOLDER, DIFFFOLDER,
|
||||
keyFolder, downloadFolder, syncFolder, thumbFolder, diffFolder,
|
||||
}
|
||||
return w, nil
|
||||
}
|
||||
@@ -103,7 +103,7 @@ func (fw *FileWatcher) BeginWatcherRoutine(ctx context.Context, wg *sync.WaitGro
|
||||
Total: 100,
|
||||
}
|
||||
eventContext := context.WithValue(cancelContext, key(event.Path), e)
|
||||
if err := manageFileDiffing(eventContext, event.Path, syncFilePath, fw.DIFFFOLDER, true, diffChannel, wg); err != nil {
|
||||
if err := manageFileDiffing(eventContext, event.Path, syncFilePath, fw.DiffFolder, true, diffChannel, wg); err != nil {
|
||||
// I don't think this can be reached...
|
||||
fw.Warn().Msgf("Error managing the diffing process %s", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user