Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

chore(endpoint): run updater across business hours

shukieshahac003a830a35
diff --git a/cli/beacon/internal/endpoint/service/updater.go b/cli/beacon/internal/endpoint/service/updater.go
index 717e27c2..054374c6 100644
--- a/cli/beacon/internal/endpoint/service/updater.go
+++ b/cli/beacon/internal/endpoint/service/updater.go
@@ -86,8 +86,8 @@ func (m UpdaterManager) Status() Status {
return status
}
-// updaterPlist renders the updater LaunchDaemon. It runs daily at 2 PM local
-// time and does not
+// updaterPlist renders the updater LaunchDaemon. It runs at business-hour
+// intervals in local time and does not
// RunAtLoad or KeepAlive; each invocation resolves the configured mode.
func updaterPlist(label, program string) string {
return fmt.Sprintf(`<?xml version="1.0" encoding="UTF-8"?>
@@ -104,12 +104,38 @@ func updaterPlist(label, program string) string {
<string>--scheduled</string>
</array>
<key>StartCalendarInterval</key>
+ <array>
+ <dict>
+ <key>Hour</key>
+ <integer>9</integer>
+ <key>Minute</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>Hour</key>
+ <integer>12</integer>
+ <key>Minute</key>
+ <integer>0</integer>
+ </dict>
<dict>
<key>Hour</key>
- <integer>14</integer>
+ <integer>15</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
+ <dict>
+ <key>Hour</key>
+ <integer>18</integer>
+ <key>Minute</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>Hour</key>
+ <integer>21</integer>
+ <key>Minute</key>
+ <integer>0</integer>
+ </dict>
+ </array>
<key>RunAtLoad</key>
<false/>
<key>StandardOutPath</key>
diff --git a/cli/beacon/internal/endpoint/service/updater_test.go b/cli/beacon/internal/endpoint/service/updater_test.go
index e7c641a2..42c4cd06 100644
--- a/cli/beacon/internal/endpoint/service/updater_test.go
+++ b/cli/beacon/internal/endpoint/service/updater_test.go
@@ -14,8 +14,7 @@ func TestUpdaterPlistContent(t *testing.T) {
"<string>/opt/beacon/bin/beacon</string>",
"<string>--scheduled</string>",
"<key>StartCalendarInterval</key>",
- "<key>Hour</key>",
- "<integer>14</integer>",
+ "<array>",
"<key>Minute</key>",
"<integer>0</integer>",
} {
@@ -23,6 +22,11 @@ func TestUpdaterPlistContent(t *testing.T) {
t.Errorf("plist missing %q", want)
}
}
+ for _, hour := range []string{"9", "12", "15", "18", "21"} {
+ if !strings.Contains(out, "<integer>"+hour+"</integer>") {
+ t.Errorf("plist missing hour %s", hour)
+ }
+ }
// One-shot scheduled job: must not RunAtLoad or KeepAlive.
if strings.Contains(out, "<key>KeepAlive</key>") {
t.Errorf("updater plist should not set KeepAlive")