From 490ccfbd39a1be1ae2bc2986714e72a10c0f4aa1 Mon Sep 17 00:00:00 2001 From: Carlton N Hanna Date: Fri, 27 Oct 2023 12:38:24 -0600 Subject: [PATCH] Add deletion of historical daily database version --- .../db/migration/V1_89__Delete_from_token_historical_daily.sql | 3 +++ .../io/provenance/explorer/service/async/AsyncService.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 database/src/main/resources/db/migration/V1_89__Delete_from_token_historical_daily.sql diff --git a/database/src/main/resources/db/migration/V1_89__Delete_from_token_historical_daily.sql b/database/src/main/resources/db/migration/V1_89__Delete_from_token_historical_daily.sql new file mode 100644 index 00000000..08826c58 --- /dev/null +++ b/database/src/main/resources/db/migration/V1_89__Delete_from_token_historical_daily.sql @@ -0,0 +1,3 @@ +SELECT 'Deleting from token_historical_daily dates after 8/23/2023' AS comment; + +DELETE FROM token_historical_daily WHERE historical_timestamp > '2023-08-23 00:00:00'; diff --git a/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncService.kt b/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncService.kt index d36cd199..99263ba5 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncService.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncService.kt @@ -299,7 +299,7 @@ class AsyncService( startDate = latest.timestamp.minusDays(1) } val dlobRes = tokenService.getHistoricalFromDlob(startDate) ?: return - logger.info("Updating token historical data starting from $startDate with ${dlobRes.buy.size} buy record for roll-up.") + logger.info("Updating token historical data starting from $startDate with ${dlobRes.buy.size} buy records for roll-up.") val baseMap = Interval(startDate, today) .let { int -> generateSequence(int.start) { dt -> dt.plusDays(1) }.takeWhile { dt -> dt < int.end } }