add hook for handler
change map to cmap for Trigger.hashs
This commit is contained in:
Yuzuki616
2024-10-30 01:07:17 +09:00
parent 3ff99d4fd1
commit ffcbec4ede
8 changed files with 75 additions and 10 deletions

View File

@@ -17,13 +17,13 @@ func (t *Trigger) addCronHandle(cron any, job cron.FuncJob) (cron.EntryID, error
}
func (t *Trigger) hashEqualsOrStore(name, hash string) bool {
if h, ok := t.hashs[name]; ok {
if h, ok := t.hashs.Get(name); ok {
if h == hash {
return true
}
t.hashs[name] = hash
t.hashs.Set(name, hash)
} else {
t.hashs[name] = hash
t.hashs.Set(name, hash)
}
return false
}