mirror of
https://github.com/InazumaV/Ratte.git
synced 2026-02-04 12:40:12 +00:00
update
add hook for handler change map to cmap for Trigger.hashs
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"Ratte/handler"
|
||||
"fmt"
|
||||
"github.com/Yuzuki616/Ratte-Interface/panel"
|
||||
cmap "github.com/orcaman/concurrent-map/v2"
|
||||
"github.com/robfig/cron/v3"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -16,7 +17,7 @@ type Trigger struct {
|
||||
p panel.Panel
|
||||
remoteId int
|
||||
remoteC *conf.Remote
|
||||
hashs map[string]string
|
||||
hashs cmap.ConcurrentMap[string, string]
|
||||
}
|
||||
|
||||
func NewTrigger(
|
||||
|
||||
Reference in New Issue
Block a user