Skip to content

Commit adb5eba

Browse files
committed
chore(APP): update task sync interval defaults
Replace 30-second cold-start intervals with moderate production cadences and align task fallbacks, README, Docker examples, and config-loader migration for RC installs.
1 parent 10ca725 commit adb5eba

16 files changed

Lines changed: 52 additions & 49 deletions

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ In the `CHIA_ROOT` directory (usually `~/.chia/mainnet` on Linux), CADT will add
280280
* **ONLY_CADT_SUBSCRIPTIONS**: When `true` (the default), CADT keeps DataLayer subscriptions aligned with the governance **orgList** in both directions. Organizations removed from the orgList are unsubscribed from DataLayer (`subscribed: false`); already-synced registry data on this node is **not** deleted. Organizations on the orgList that are not subscribed are subscribed (including orgs re-added after a prior removal, including orgs previously removed via the API delete flow). The home organization and governance body store are never auto-unsubscribed. Reconciliation runs only when a **non-empty** orgList is present locally (after a successful governance sync); an empty orgList is treated as “not ready” and does not trigger unsubscribes. Set to `false` to disable orglist-driven subscribe/unsubscribe reconciliation. While enabled, a manual unsubscribe of an org still listed on the orgList will be reverted on the next sync cycle.
281281
* **LOG_LEVEL**: Controls verbosity of logging. Common settings are `info` and `debug`. Setting to `silly` will log all queries.
282282
* **TASKS**: Section for configuring sync intervals.
283-
* **GOVERNANCE_SYNC_TASK_INTERVAL**: Syncs picklist, orgList, and glossary from the governance node. Default 30 seconds.
284-
* **DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL**: Subscribes to and imports default organizations published by the governance node. Default 30 seconds.
285-
* **ORGANIZATION_META_SYNC_TASK_INTERVAL**: Refreshes metadata for already-imported organizations. Default 300 seconds.
286-
* **PICKLIST_SYNC_TASK_INTERVAL**: Syncs picklist from the governance node. Default 30 seconds.
287-
* **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.
288-
* **VALIDATE_ORGANIZATION_TABLE_TASK_INTERVAL**: Validates the organization table periodically. Default 1800 seconds.
283+
* **GOVERNANCE_SYNC_TASK_INTERVAL**: Syncs picklist, orgList, and glossary from the governance node. Default 300 seconds (5 minutes).
284+
* **ORGANIZATION_META_SYNC_TASK_INTERVAL**: Subscribes to default organizations and refreshes metadata for already-imported organizations. Default 300 seconds (5 minutes).
285+
* **PICKLIST_SYNC_TASK_INTERVAL**: Syncs picklist from the governance node. Default 300 seconds (5 minutes).
286+
* **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 900 seconds (15 minutes).
287+
* **VALIDATE_ORGANIZATION_TABLE_TASK_INTERVAL**: Validates the organization table periodically. Default 1800 seconds (30 minutes).
288+
* **COIN_MANAGEMENT_TASK_INTERVAL**: Splits wallet coins when usable coin count is low. Default 21600 seconds (6 hours).
289289
* **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.
290290
* **STAGING**:
291291
* **EDIT_DATA_LEN**: Maximum number of items in staging edit operations. Default 200.

docker-compose-example.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ services:
2222
- CHIA_NETWORK=mainnet
2323
- USE_DEVELOPMENT_MODE=false
2424
- IS_GOVERNANCE_BODY=false
25-
- DEFAULT_FEE=300000000
26-
- DEFAULT_COIN_AMOUNT=300000000
25+
- DEFAULT_FEE=3000
26+
- DEFAULT_COIN_AMOUNT=300
2727
- CERTIFICATE_FOLDER_PATH=null
2828
- DATALAYER_FILE_SERVER_URL=null
2929
- AUTO_SUBSCRIBE_FILESTORE=false
3030
- AUTO_MIRROR_EXTERNAL_STORES=true
3131
- LOG_LEVEL=info
3232

3333
# APP.TASKS settings
34-
- GOVERNANCE_SYNC_TASK_INTERVAL=30
35-
- DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL=30
34+
- GOVERNANCE_SYNC_TASK_INTERVAL=300
3635
- ORGANIZATION_META_SYNC_TASK_INTERVAL=300
37-
- PICKLIST_SYNC_TASK_INTERVAL=30
38-
- MIRROR_CHECK_TASK_INTERVAL=86460
36+
- PICKLIST_SYNC_TASK_INTERVAL=300
37+
- MIRROR_CHECK_TASK_INTERVAL=900
3938
- VALIDATE_ORGANIZATION_TABLE_TASK_INTERVAL=1800
39+
- COIN_MANAGEMENT_TASK_INTERVAL=21600
4040

4141
# GOVERNANCE settings
4242
- GOVERNANCE_BODY_ID=23f6498e015ebcd7190c97df30c032de8deb5c8934fc1caa928bc310e2b8a57e

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ update_app_config "TRUST_PROXY" '.TRUST_PROXY'
110110

111111
# APP.TASKS section (shared)
112112
update_app_config "GOVERNANCE_SYNC_TASK_INTERVAL" '.TASKS.GOVERNANCE_SYNC_TASK_INTERVAL'
113-
update_app_config "DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL" '.TASKS.DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL'
114113
update_app_config "ORGANIZATION_META_SYNC_TASK_INTERVAL" '.TASKS.ORGANIZATION_META_SYNC_TASK_INTERVAL'
115114
update_app_config "PICKLIST_SYNC_TASK_INTERVAL" '.TASKS.PICKLIST_SYNC_TASK_INTERVAL'
116115
update_app_config "MIRROR_CHECK_TASK_INTERVAL" '.TASKS.MIRROR_CHECK_TASK_INTERVAL'
117116
update_app_config "VALIDATE_ORGANIZATION_TABLE_TASK_INTERVAL" '.TASKS.VALIDATE_ORGANIZATION_TABLE_TASK_INTERVAL'
117+
update_app_config "COIN_MANAGEMENT_TASK_INTERVAL" '.TASKS.COIN_MANAGEMENT_TASK_INTERVAL'
118118

119119
# APP.REQUEST_CONTENT_LIMITS section (shared)
120120
update_app_config "STAGING_EDIT_DATA_LEN" '.REQUEST_CONTENT_LIMITS.STAGING.EDIT_DATA_LEN'

src/tasks/mirror-check-v2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ const task = new Task('mirror-check-v2', async () => {
3232
}
3333
} catch (error) {
3434
loggerV2.error(
35-
`[v2]: Mirror check failed. Retrying in ${APP_CONFIG?.TASKS?.MIRROR_CHECK_TASK_INTERVAL || 300} seconds`,
35+
`[v2]: Mirror check failed. Retrying in ${APP_CONFIG?.TASKS?.MIRROR_CHECK_TASK_INTERVAL || 900} seconds`,
3636
error,
3737
);
3838
}
3939
});
4040

4141
const job = new SimpleIntervalJob(
4242
{
43-
seconds: APP_CONFIG?.TASKS?.MIRROR_CHECK_TASK_INTERVAL || 300,
43+
seconds: APP_CONFIG?.TASKS?.MIRROR_CHECK_TASK_INTERVAL || 900,
4444
runImmediately: true,
4545
},
4646
task,

src/tasks/mirror-check.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ const task = new Task('mirror-check', async () => {
2828
}
2929
} catch (error) {
3030
logger.error(
31-
`[v1]: Mirror check failed. Retrying in ${APP_CONFIG?.TASKS?.MIRROR_CHECK_TASK_INTERVAL || 300} seconds`,
31+
`[v1]: Mirror check failed. Retrying in ${APP_CONFIG?.TASKS?.MIRROR_CHECK_TASK_INTERVAL || 900} seconds`,
3232
error,
3333
);
3434
}
3535
});
3636

3737
const job = new SimpleIntervalJob(
3838
{
39-
seconds: APP_CONFIG?.TASKS?.MIRROR_CHECK_TASK_INTERVAL || 300,
39+
seconds: APP_CONFIG?.TASKS?.MIRROR_CHECK_TASK_INTERVAL || 900,
4040
runImmediately: true,
4141
},
4242
task,

src/tasks/sync-default-organizations-v2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ const task = new Task('sync-default-organizations-v2', async () => {
142142
} catch (error) {
143143
loggerV2.error(
144144
`[v2]: failed to validate default organization records and subscriptions. Error ${error.message}. ` +
145-
`Retrying in ${CONFIG?.TASKS?.DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL || 30} seconds`,
145+
`Retrying in ${CONFIG?.TASKS?.ORGANIZATION_META_SYNC_TASK_INTERVAL || 300} seconds`,
146146
);
147147
}
148148
});
149149

150150
const job = new SimpleIntervalJob(
151151
{
152-
seconds: CONFIG?.TASKS?.DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL || 30,
152+
seconds: CONFIG?.TASKS?.ORGANIZATION_META_SYNC_TASK_INTERVAL || 300,
153153
runImmediately: true,
154154
},
155155
task,

src/tasks/sync-default-organizations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ const task = new Task('sync-default-organizations', async () => {
131131
} catch (error) {
132132
logger.error(
133133
`failed to validate default organization records and subscriptions. Error ${error.message}. ` +
134-
`Retrying in ${CONFIG?.APP?.TASKS?.DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL || 30} seconds`,
134+
`Retrying in ${CONFIG?.APP?.TASKS?.ORGANIZATION_META_SYNC_TASK_INTERVAL || 300} seconds`,
135135
);
136136
}
137137
});
138138

139139
const job = new SimpleIntervalJob(
140140
{
141-
seconds: CONFIG?.APP?.TASKS?.DEFAULT_ORGANIZATIONS_SYNC_TASK_INTERVAL || 30,
141+
seconds: CONFIG?.APP?.TASKS?.ORGANIZATION_META_SYNC_TASK_INTERVAL || 300,
142142
runImmediately: true,
143143
},
144144
task,

src/tasks/sync-governance-body-v2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ const task = new Task('sync-governance-meta-v2', async () => {
5454
} catch (error) {
5555
loggerV2.error(
5656
`[v2]: Cannot download Governance data, Retrying in ${
57-
CONFIG?.TASKS?.GOVERNANCE_SYNC_TASK_INTERVAL || 30
57+
CONFIG?.TASKS?.GOVERNANCE_SYNC_TASK_INTERVAL || 300
5858
} seconds. Error: ${error.message}`,
5959
);
6060
}
6161
});
6262

6363
const job = new SimpleIntervalJob(
6464
{
65-
seconds: CONFIG?.TASKS?.GOVERNANCE_SYNC_TASK_INTERVAL || 30,
65+
seconds: CONFIG?.TASKS?.GOVERNANCE_SYNC_TASK_INTERVAL || 300,
6666
runImmediately: true,
6767
},
6868
task,

src/tasks/sync-governance-body.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const task = new Task('sync-governance-meta', async () => {
4444
} catch (error) {
4545
logger.error(
4646
`Cant download Goverance data, Retrying in ${
47-
CONFIG?.APP?.TASKS?.GOVERNANCE_SYNC_TASK_INTERVAL || 30
47+
CONFIG?.APP?.TASKS?.GOVERNANCE_SYNC_TASK_INTERVAL || 300
4848
} seconds`,
4949
error,
5050
);
@@ -53,7 +53,7 @@ const task = new Task('sync-governance-meta', async () => {
5353

5454
const job = new SimpleIntervalJob(
5555
{
56-
seconds: CONFIG?.APP?.TASKS?.GOVERNANCE_SYNC_TASK_INTERVAL || 30,
56+
seconds: CONFIG?.APP?.TASKS?.GOVERNANCE_SYNC_TASK_INTERVAL || 300,
5757
runImmediately: true,
5858
},
5959
task,

src/tasks/sync-picklists-v2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ const task = new Task('sync-picklist-v2', async () => {
1818
}
1919
} catch (error) {
2020
loggerV2.error(
21-
`Retrying in ${CONFIG?.TASKS?.PICKLIST_SYNC_TASK_INTERVAL || 30} seconds`,
21+
`Retrying in ${CONFIG?.TASKS?.PICKLIST_SYNC_TASK_INTERVAL || 300} seconds`,
2222
error,
2323
);
2424
}
2525
});
2626

2727
const job = new SimpleIntervalJob(
2828
{
29-
seconds: CONFIG?.TASKS?.PICKLIST_SYNC_TASK_INTERVAL || 30,
29+
seconds: CONFIG?.TASKS?.PICKLIST_SYNC_TASK_INTERVAL || 300,
3030
runImmediately: true,
3131
},
3232
task,

0 commit comments

Comments
 (0)