From 277651c7e1f6deb6793b50aa8c5d9f17dd222cf3 Mon Sep 17 00:00:00 2001 From: jiangdong1992 Date: Thu, 30 Jun 2022 23:12:39 +0800 Subject: [PATCH 1/3] Log add time condition --- indexer_provider.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indexer_provider.py b/indexer_provider.py index 4a22eb5..9c06bc1 100644 --- a/indexer_provider.py +++ b/indexer_provider.py @@ -5,6 +5,7 @@ from config import Cfg import psycopg2 import decimal +import time class DecimalEncoder(json.JSONEncoder): def default(self, o): @@ -50,7 +51,10 @@ def get_actions(network_id, account_id): password=Cfg.NETWORK[network_id]["INDEXER_PWD"], host=Cfg.NETWORK[network_id]["INDEXER_HOST"], port=Cfg.NETWORK[network_id]["INDEXER_PORT"]) - cur=conn.cursor() + cur=conn.cursor() + + now_time = int(time.time()) + old_time = (now_time - (90 * 24 * 60 * 60)) * 1000000000 sql1 = ( "select " @@ -63,7 +67,7 @@ def get_actions(network_id, account_id): "status " "from action_receipt_actions join receipts using(receipt_id) " "join execution_outcomes using(receipt_id) " - "where action_kind = 'FUNCTION_CALL' and ( " + "where action_kind = 'FUNCTION_CALL' and included_in_block_timestamp > %s and ( " % old_time ) sql2 = """(predecessor_account_id = %s and """ From 63804838068476b422d5e9f484b850f84f8e8e50 Mon Sep 17 00:00:00 2001 From: jiangdong1992 Date: Thu, 30 Jun 2022 23:13:11 +0800 Subject: [PATCH 2/3] Log add time condition --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index a0b3869..038c251 100644 --- a/app.py +++ b/app.py @@ -16,7 +16,7 @@ from config import Cfg from db_provider import get_history_token_price -service_version = "20220622.01" +service_version = "20220630.01" Welcome = 'Welcome to ref datacenter API server, version '+service_version+', indexer %s' % Cfg.NETWORK[Cfg.NETWORK_ID]["INDEXER_HOST"][-3:] # Instantiation, which can be regarded as fixed format app = Flask(__name__) From 05f42d74aa447a7721a345f9a508361f63517a29 Mon Sep 17 00:00:00 2001 From: jiangdong1992 Date: Fri, 1 Jul 2022 16:48:31 +0800 Subject: [PATCH 3/3] Log add time condition 30 day --- indexer_provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indexer_provider.py b/indexer_provider.py index 9c06bc1..283ab90 100644 --- a/indexer_provider.py +++ b/indexer_provider.py @@ -54,7 +54,7 @@ def get_actions(network_id, account_id): cur=conn.cursor() now_time = int(time.time()) - old_time = (now_time - (90 * 24 * 60 * 60)) * 1000000000 + old_time = (now_time - (30 * 24 * 60 * 60)) * 1000000000 sql1 = ( "select "