Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update get_update_time #219

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion backends/toncenter_cpp/apps_v2_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ def __init__(self, connection):
Update time for auxiliary table with messages
"""
def get_update_time(self, config: SeasonConfig):
return 1726138800
with self.connection.cursor(cursor_factory=psycopg2.extras.RealDictCursor) as cursor:
cursor.execute("""
select gen_utime as last_time from blocks
where workchain = -1 and shard = -9223372036854775808 order by seqno desc limit 1
""")
return cursor.fetchone()['last_time']

def _do_calculate(self, config: SeasonConfig, dry_run: bool = False):

Expand Down
6 changes: 3 additions & 3 deletions backends/toncenter_cpp/apps_v2_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def __init__(self, connection, produce_output=False):
"""
def get_update_time(self, config: SeasonConfig):
with self.connection.cursor(cursor_factory=psycopg2.extras.RealDictCursor) as cursor:
cursor.execute(f"""
select gen_utime as last_time from blocks
where workchain = -1 order by gen_utime desc limit 1
cursor.execute("""
select gen_utime as last_time from blocks
where workchain = -1 and shard = -9223372036854775808 order by seqno desc limit 1
""")
return cursor.fetchone()['last_time']

Expand Down
4 changes: 2 additions & 2 deletions backends/toncenter_cpp/nfts.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def __init__(self, connection):
def get_update_time(self, config: SeasonConfig):
with self.connection.cursor(cursor_factory=psycopg2.extras.RealDictCursor) as cursor:
cursor.execute("""
select gen_utime as last_time from blocks
where workchain = -1 order by gen_utime desc limit 1
select gen_utime as last_time from blocks
where workchain = -1 and shard = -9223372036854775808 order by seqno desc limit 1
""")
return cursor.fetchone()['last_time']

Expand Down
Loading