Refactor workers
This commit is contained in:
@@ -41,6 +41,13 @@ func (se *ScriptExecutor) Execute() (string, error) {
|
||||
return out.String(), nil
|
||||
}
|
||||
|
||||
func (t *TorrentManager) TriggerHookOnLibraryUpdate(updatedPaths []string) {
|
||||
_ = t.workerPool.Submit(func() {
|
||||
OnLibraryUpdateHook(updatedPaths, t.Config, t.log)
|
||||
t.log.Debugf("Triggered hook on_library_update for %d path(s)", len(updatedPaths))
|
||||
})
|
||||
}
|
||||
|
||||
func OnLibraryUpdateHook(paths []string, config config.ConfigInterface, log *logutil.Logger) {
|
||||
executor := &ScriptExecutor{
|
||||
Script: config.GetOnLibraryUpdate(),
|
||||
|
||||
Reference in New Issue
Block a user