mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 10:30:37 +09:00
Disable imported timer heartbeats
Prevent company imports from re-enabling scheduler heartbeats on imported agents and cover both new-company and existing-company import flows in portability tests. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
dcead97650
commit
f9927bdaaa
2 changed files with 69 additions and 1 deletions
|
|
@ -619,6 +619,14 @@ function clonePortableRecord(value: unknown) {
|
|||
return structuredClone(value) as Record<string, unknown>;
|
||||
}
|
||||
|
||||
function disableImportedTimerHeartbeat(runtimeConfig: unknown) {
|
||||
const next = clonePortableRecord(runtimeConfig) ?? {};
|
||||
const heartbeat = isPlainRecord(next.heartbeat) ? { ...next.heartbeat } : {};
|
||||
heartbeat.enabled = false;
|
||||
next.heartbeat = heartbeat;
|
||||
return next;
|
||||
}
|
||||
|
||||
function normalizePortableProjectWorkspaceExtension(
|
||||
workspaceKey: string,
|
||||
value: unknown,
|
||||
|
|
@ -3853,7 +3861,7 @@ export function companyPortabilityService(db: Db, storage?: StorageService) {
|
|||
reportsTo: null,
|
||||
adapterType: effectiveAdapterType,
|
||||
adapterConfig: adapterConfigWithSkills,
|
||||
runtimeConfig: manifestAgent.runtimeConfig,
|
||||
runtimeConfig: disableImportedTimerHeartbeat(manifestAgent.runtimeConfig),
|
||||
budgetMonthlyCents: manifestAgent.budgetMonthlyCents,
|
||||
permissions: manifestAgent.permissions,
|
||||
metadata: manifestAgent.metadata,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue