Skip to content

Commit

Permalink
add last_update column
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerKSI committed Jun 20, 2023
1 parent 95ed570 commit 176f629
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions flusher/flusher/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ def Column(*args, **kwargs):
Column("date", CustomDate, primary_key=True),
Column("oracle_script_id", sa.Integer, sa.ForeignKey("oracle_scripts.id"), primary_key=True),
Column("count", sa.Integer),
Column("last_update", CustomDateTime),
)

incoming_packets = sa.Table(
Expand Down
2 changes: 1 addition & 1 deletion flusher/flusher/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def handle_new_request(self, msg):
del msg["tx_hash"]
if "timestamp" in msg:
self.handle_set_request_count_per_day({"date": msg["timestamp"]})
self.handle_set_request_count_per_oracle_script_and_day({"date": msg["timestamp"], "oracle_script_id": msg["oracle_script_id"]})
self.handle_set_request_count_per_oracle_script_and_day({"date": msg["timestamp"], "oracle_script_id": msg["oracle_script_id"], "last_update": msg["timestamp"]})
del msg["timestamp"]
self.conn.execute(requests.insert(), msg)
self.increase_oracle_script_count(msg["oracle_script_id"])
Expand Down

0 comments on commit 176f629

Please sign in to comment.