Skip to content

Commit 64eab3e

Browse files
authored
fix total dao funds update (#694)
1 parent 043eeda commit 64eab3e

File tree

10 files changed

+31
-35
lines changed

10 files changed

+31
-35
lines changed

.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ NOTIFI_SECRET=NOTIFI_SECRET
5353
NOTIFI_PREFIX="dev"
5454

5555
AGGREGATOR_EXPIRED_PROPOSALS_POLLING_INTERVAL=60000
56-
AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL=100000
56+
AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL=3600000
5757
# 12 hours
5858
AGGREGATOR_DAO_STATUS_POLLING_INTERVAL=43200000
5959
# Every day at 23:55

.github/env.production

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ HELM_FRONTEND_URL=https://app.astrodao.com
99
HELM_NEAR_BRIDGE_TOKEN_FACTORY_CONTRACT_NAME=factory.bridge.near
1010
HELM_HELM_NEAR_NFT_WHITELIST_CONTRACTS=starpause.mintbase1.near
1111
HELM_NEAR_TOKEN_API_URL=https://api.stats.ref.finance/api
12-
HELM_AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL=100000
12+
HELM_AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL=3600000
1313
# 12 hours
1414
HELM_AGGREGATOR_DAO_STATUS_POLLING_INTERVAL=43200000
1515
# Every day at 23:55

.github/env.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ HELM_FRONTEND_URL=https://testnet.app.astrodao.com
99
HELM_NEAR_BRIDGE_TOKEN_FACTORY_CONTRACT_NAME=f.ropsten.testnet
1010
HELM_TEST_ENV_NAME=testnet
1111
HELM_NEAR_TOKEN_API_URL=https://api.stats.ref.finance/api
12-
HELM_AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL=100000
12+
HELM_AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL=3600000
1313
# 12 hours
1414
HELM_AGGREGATOR_DAO_STATUS_POLLING_INTERVAL=43200000
1515
# Every day at 23:55

apps/aggregator/deployment/app-chart/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ environment:
9595
NEAR_TOKEN_FACTORY_CONTRACT_NAME: "tokenfactory.testnet"
9696
NEAR_BRIDGE_TOKEN_FACTORY_CONTRACT_NAME: "f.ropsten.testnet"
9797
AGGREGATOR_EXPIRED_PROPOSALS_POLLING_INTERVAL: "60000"
98-
AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL: "100000"
98+
AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL: "3600000"
9999
# 12 hours
100100
AGGREGATOR_DAO_STATUS_POLLING_INTERVAL: "43200000"
101101
# Every day at 23:55

apps/aggregator/src/dao-aggregator/dao-aggregator.service.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ export class DaoAggregatorService {
6262
);
6363
})
6464
.process((dao) =>
65-
this.daoService.save(dao, { updateTotalDaoFunds: true }),
65+
this.daoService.save(
66+
{ id: dao.id },
67+
{ updateTotalDaoFunds: true, allowDynamo: false },
68+
),
6669
);
6770
}
6871

apps/api/deployment/app-chart/values.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,5 @@ monitoring:
9797
port: api
9898

9999
environment:
100-
AGGREGATOR_EXPIRED_PROPOSALS_POLLING_INTERVAL: "60000"
101-
AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL: "100000"
102-
# 12 hours
103-
AGGREGATOR_DAO_STATUS_POLLING_INTERVAL: "43200000"
104-
# Every day at 23:55
105-
AGGREGATOR_DAO_STATS_CRON_TIME: "55 23 * * *"
106100
API_RATE_TTL: "60"
107101
API_RATE_LIMIT: "5"

apps/draft/deployment/app-chart/values.yaml

+1-9
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,4 @@ monitoring:
9090
- path: /api/v1/metrics
9191
port: api
9292

93-
environment:
94-
AGGREGATOR_EXPIRED_PROPOSALS_POLLING_INTERVAL: "60000"
95-
AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL: "100000"
96-
# 12 hours
97-
AGGREGATOR_DAO_STATUS_POLLING_INTERVAL: "43200000"
98-
# Every day at 23:55
99-
AGGREGATOR_DAO_STATS_CRON_TIME: "55 23 * * *"
100-
API_RATE_TTL: "60"
101-
API_RATE_LIMIT: "5"
93+
environment: {}

apps/notifier/deployment/app-chart/values.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,4 @@ version:
8989
commit: latest
9090
branch: develop
9191

92-
environment:
93-
AGGREGATOR_EXPIRED_PROPOSALS_POLLING_INTERVAL: "60000"
94-
AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL: "100000"
92+
environment: {}

libs/dynamodb/src/dynamodb.service.ts

+16-11
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,6 @@ export class DynamodbService {
247247
checkIfExists = true,
248248
tableName = this.tableName,
249249
): Promise<PartialEntity<M> | undefined> {
250-
this.logger.debug(
251-
`[DynamoDB] Update: ${data.partitionId}:${
252-
data.entityId
253-
} (${JSON.stringify(data)})`,
254-
);
255250
// eslint-disable-next-line @typescript-eslint/no-unused-vars
256251
const { partitionId, entityId, entityType, ...rest } = data;
257252
const dataToUpdate = {
@@ -293,10 +288,14 @@ export class DynamodbService {
293288
ReturnValues: 'ALL_NEW',
294289
})
295290
.promise()
296-
.then(
297-
({ Attributes }) =>
298-
this.denormalizeData(Attributes) as PartialEntity<M>,
299-
);
291+
.then(({ Attributes }) => {
292+
this.logger.debug(
293+
`[DynamoDB] Update: ${data.partitionId}:${
294+
data.entityId
295+
} (${JSON.stringify(data)})`,
296+
);
297+
return this.denormalizeData(Attributes) as PartialEntity<M>;
298+
});
300299
}
301300

302301
async updateItemByType<M>(
@@ -553,7 +552,6 @@ export class DynamodbService {
553552
checkIfExists = true,
554553
tableName = this.tableName,
555554
): Promise<PartialEntity<M>> {
556-
this.logger.debug(`[DynamoDB] Put: ${data.partitionId}:${data.entityId}`);
557555
const timestamp = Date.now();
558556
const dataToPut = {
559557
createdAt: timestamp,
@@ -572,7 +570,14 @@ export class DynamodbService {
572570
: {}),
573571
})
574572
.promise()
575-
.then(() => this.denormalizeData(dataToPut));
573+
.then(() => {
574+
this.logger.debug(
575+
`[DynamoDB] Put: ${data.partitionId}:${
576+
data.entityId
577+
} (${JSON.stringify(dataToPut)})`,
578+
);
579+
return this.denormalizeData(dataToPut) as PartialEntity<M>;
580+
});
576581
}
577582

578583
async putItemByType<M>(

libs/transaction-handler/src/transaction-action-handler.service.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,11 @@ export class TransactionActionHandlerService {
13731373
`Received NFTs from RPC: ${JSON.stringify(nftData)}`,
13741374
);
13751375
await this.daoService.save(
1376-
{ id: accountId },
1376+
{
1377+
id: accountId,
1378+
updateTransactionHash: transactionHash,
1379+
updateTimestamp: timestamp,
1380+
},
13771381
{ updateNftsCount: true },
13781382
);
13791383
this.log(

0 commit comments

Comments
 (0)