You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lower scheduler tick for governance and default-org sync tasks from
300s to 30s, parallelize per-org subscribe loop with
Promise.allSettled, quiet per-tick log spam at INFO level (demote
"nothing to do" messages to DEBUG, make "Successfully synced" lines
change-aware), add rate-limited heartbeat with store IDs for DataLayer
correlation, remove redundant GovernanceV2.sync from v1 task, align
sync-picklists-v2 default to 30s, add v1 governance success logging,
and introduce DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL config key.
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,9 +269,10 @@ In the `CHIA_ROOT` directory (usually `~/.chia/mainnet` on Linux), CADT will add
269
269
***AUTO_MIRROR_EXTERNAL_STORES**: When set to true (the default), CADT will automatically create mirrors for each store you are subscribed to. Mirroring all subscriptions using the `DATALAYER_FILE_SERVER_URL` will make the entire CADT network more resilient and distributed. Note: `DATALAYER_FILE_SERVER_URL` must also be set to a valid URL or IP address for mirrors to be created. Both settings are required for external store mirroring to function.
270
270
***LOG_LEVEL**: Controls verbosity of logging. Common settings are `info` and `debug`. Setting to `silly` will log all queries.
271
271
***TASKS**: Section for configuring sync intervals.
272
-
***GOVERNANCE_SYNC_TASK_INTERVAL**: Syncs new organizations from the governance node. Default 86400 seconds.
273
-
***ORGANIZATION_META_SYNC_TASK_INTERVAL**: Syncs organization data from the blockchain. Default 300 seconds.
274
-
***PICKLIST_SYNC_TASK_INTERVAL**: Syncs picklist from the governance node. Default 60 seconds.
272
+
***GOVERNANCE_SYNC_TASK_INTERVAL**: Syncs picklist, orgList, and glossary from the governance node. Default 30 seconds.
273
+
***DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL**: Subscribes to and imports default organizations published by the governance node. Default 30 seconds.
274
+
***ORGANIZATION_META_SYNC_TASK_INTERVAL**: Refreshes metadata for already-imported organizations. Default 300 seconds.
275
+
***PICKLIST_SYNC_TASK_INTERVAL**: Syncs picklist from the governance node. Default 30 seconds.
275
276
***MIRROR_CHECK_TASK_INTERVAL**: Checks if our DataLayer is advertising our `DATALAYER_FILE_SERVER_URL` as a mirror for all subscriptions when `AUTO_MIRROR_EXTERNAL_STORES` is true. Default 86460 seconds.
276
277
***VALIDATE_ORGANIZATION_TABLE_TASK_INTERVAL**: Validates the organization table periodically. Default 1800 seconds.
277
278
***REQUEST_CONTENT_LIMITS**: Section for configuring request size limits to prevent denial-of-service attacks. These limits control the maximum array lengths in API requests.
`[v2]: CADT is waiting for DataLayer to sync default organization stores: ${imported.length} imported, ${pending.length} waiting [${sample.join(', ')}${extra}]. Next check within 30s.`,
62
+
);
63
+
}
64
+
}
65
+
66
+
// Fan out imports in parallel
67
+
constresults=awaitPromise.allSettled(
68
+
pending.map(async(orgUid)=>{
42
69
loggerV2.debug(
43
70
`[v2]: default organization ${orgUid} was NOT found in the organizations table. running the import process to correct`,
44
71
);
45
-
try{
46
-
awaitOrganizationsV2.importOrganization(orgUid);
47
-
// Verify the org was actually created (importOrganization may return early
48
-
// if store is not synced yet, without throwing an error)
`[v2]: Import of default organization ${orgUid} deferred - store may still be syncing. Will retry on next task run.`,
65
82
);
66
83
}
67
-
}else{
68
-
constorgReduced={ ...organization};
69
-
deleteorgReduced.icon;
70
-
deleteorgReduced.metadata;
71
-
loggerV2.debug(
72
-
`sync default orgs task found the following organization data associated with default org (icon and meta removed for compactness) ${orgUid}:\n${JSON.stringify(orgReduced)}`,
84
+
}),
85
+
);
86
+
87
+
for(constresultofresults){
88
+
if(result.status==='rejected'){
89
+
loggerV2.warn(
90
+
`[v2]: Failed to import a default organization: ${result.reason?.message||result.reason}. Will retry on next task run.`,
73
91
);
74
92
}
75
93
}
76
94
}
77
95
}catch(error){
78
96
loggerV2.error(
79
97
`[v2]: failed to validate default organization records and subscriptions. Error ${error.message}. `+
80
-
`Retrying in ${CONFIG?.TASKS?.ORGANIZATION_META_SYNC_TASK_INTERVAL||300} seconds`,
98
+
`Retrying in ${CONFIG?.TASKS?.DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL||30} seconds`,
0 commit comments