|
@@ -43,7 +43,7 @@ func AddHook(ifaceToAdd interface{}) {
|
|
timeHooks = append(timeHooks, ifaceToAdd)
|
|
timeHooks = append(timeHooks, ifaceToAdd)
|
|
}
|
|
}
|
|
|
|
|
|
-var HookManangerCh = make(chan models.HookDetails, 2)
|
|
|
|
|
|
+var HookManagerCh = make(chan models.HookDetails, 2)
|
|
|
|
|
|
func StartHookManager(ctx context.Context, wg *sync.WaitGroup) {
|
|
func StartHookManager(ctx context.Context, wg *sync.WaitGroup) {
|
|
defer wg.Done()
|
|
defer wg.Done()
|
|
@@ -52,7 +52,7 @@ func StartHookManager(ctx context.Context, wg *sync.WaitGroup) {
|
|
case <-ctx.Done():
|
|
case <-ctx.Done():
|
|
logger.Log(0, "## Stopping Hook Manager")
|
|
logger.Log(0, "## Stopping Hook Manager")
|
|
return
|
|
return
|
|
- case newhook := <-HookManangerCh:
|
|
|
|
|
|
+ case newhook := <-HookManagerCh:
|
|
wg.Add(1)
|
|
wg.Add(1)
|
|
go addHookWithInterval(ctx, wg, newhook.Hook, newhook.Interval)
|
|
go addHookWithInterval(ctx, wg, newhook.Hook, newhook.Interval)
|
|
}
|
|
}
|