@cfio/cohort-sync 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -8
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11760,8 +11760,10 @@ function initCommandSubscription(cfg, logger, resolveAgentName) {
|
|
|
11760
11760
|
handleCronCommand(cmd.type, cmd.payload.jobId, logger);
|
|
11761
11761
|
try {
|
|
11762
11762
|
const freshJobs = fetchCronJobs(logger);
|
|
11763
|
-
|
|
11764
|
-
|
|
11763
|
+
if (freshJobs !== null) {
|
|
11764
|
+
const resolvedJobs = resolveAgentName ? freshJobs.map((j) => ({ ...j, agentId: j.agentId ? resolveAgentName(j.agentId) : j.agentId })) : freshJobs;
|
|
11765
|
+
await pushCronSnapshot(cfg.apiKey, resolvedJobs);
|
|
11766
|
+
}
|
|
11765
11767
|
} catch (snapErr) {
|
|
11766
11768
|
logger.warn(`cohort-sync: post-command snapshot push failed: ${String(snapErr)}`);
|
|
11767
11769
|
}
|
|
@@ -11965,7 +11967,7 @@ function fetchCronJobs(logger) {
|
|
|
11965
11967
|
}));
|
|
11966
11968
|
} catch (err) {
|
|
11967
11969
|
logger.warn(`cohort-sync: failed to fetch cron jobs: ${String(err)}`);
|
|
11968
|
-
return
|
|
11970
|
+
return null;
|
|
11969
11971
|
}
|
|
11970
11972
|
}
|
|
11971
11973
|
function formatSchedule(schedule) {
|
|
@@ -13115,11 +13117,13 @@ Do not attempt to make more comments until ${resetAt}.`
|
|
|
13115
13117
|
saveSessionsToDisk(tracker);
|
|
13116
13118
|
try {
|
|
13117
13119
|
const cronJobs2 = fetchCronJobs(logger);
|
|
13118
|
-
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13120
|
+
if (cronJobs2 !== null) {
|
|
13121
|
+
const resolvedJobs = cronJobs2.map((job) => ({
|
|
13122
|
+
...job,
|
|
13123
|
+
agentId: job.agentId ? resolveAgentName(job.agentId) : job.agentId
|
|
13124
|
+
}));
|
|
13125
|
+
await pushCronSnapshot(cfg.apiKey, resolvedJobs);
|
|
13126
|
+
}
|
|
13123
13127
|
} catch (err) {
|
|
13124
13128
|
logger.warn(`cohort-sync: heartbeat cron push failed: ${String(err)}`);
|
|
13125
13129
|
}
|
package/dist/package.json
CHANGED