Skip to content

Commit

Permalink
update volume once everyday
Browse files Browse the repository at this point in the history
  • Loading branch information
0xTFM committed Jul 19, 2024
1 parent 754797e commit cf74845
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public CustomProcedureRepository(JdbcTemplate jdbcTemplate) {
}

public void updateFlatTablesStats() {
jdbcTemplate.execute("CALL public.update_flat_tables_blockchains();");
jdbcTemplate.execute("CALL public.update_flat_tables_calcs(now()::timestamp without time zone);");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ public void updateFlatTablesScheduler(ScheduledTaskRegistrar taskRegistrar) {
}

public void updateBlockchainStatsFromIbcScheduler(ScheduledTaskRegistrar taskRegistrar) {
taskRegistrar.addFixedDelayTask(
processor.updateBlockchainStatsFromIbc();
taskRegistrar.addCronTask(
() -> {
processor.updateBlockchainStatsFromIbc();
},
Long.parseLong(updateBlockchainStatsSyncTime)
this.updateBlockchainStatsSyncTime
);
}
}
3 changes: 2 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ commands:
sync-time: 15000

update_blockchain_stats_from_ibc:
sync-time: 3600000
# 00:00:01 UTC every day
sync-time: "1 0 0 * * ?"

spring:
main:
Expand Down

0 comments on commit cf74845

Please sign in to comment.