mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-15 00:27:29 +08:00
feat: add session auto-planning and resource-based concurrency scheduling
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
package autonomy
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestShouldNotify_RespectsNotifyAllowFrom(t *testing.T) {
|
||||
e := &Engine{opts: Options{
|
||||
DefaultNotifyChannel: "telegram",
|
||||
DefaultNotifyChatID: "chat-1",
|
||||
NotifyAllowFrom: []string{"chat-2", "chat-3"},
|
||||
NotifyAllowFrom: []string{"chat-2", "chat-3"},
|
||||
NotifyCooldownSec: 1,
|
||||
NotifySameReasonCooldownSec: 1,
|
||||
}}
|
||||
}, lastNotify: map[string]time.Time{}}
|
||||
if e.shouldNotify("k1", "") {
|
||||
t.Fatalf("expected notify to be blocked when chat not in allowlist")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user