diff --git a/flusher/flusher/db.py b/flusher/flusher/db.py index 5cb012ae0..4fb493319 100644 --- a/flusher/flusher/db.py +++ b/flusher/flusher/db.py @@ -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( diff --git a/flusher/flusher/handler.py b/flusher/flusher/handler.py index 64ca6eb0d..7121d5139 100644 --- a/flusher/flusher/handler.py +++ b/flusher/flusher/handler.py @@ -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"])