Skip to content

Commit

Permalink
Merge pull request flashbots#286 from flashbots/export-filename
Browse files Browse the repository at this point in the history
Add timestamp to filename
  • Loading branch information
gheise authored Mar 2, 2022
2 parents be280ab + 440c5f0 commit 7a0b21b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mev_inspect/s3_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import logging
import os
from datetime import datetime
from typing import Iterator, Optional, Tuple, TypeVar

import boto3
Expand Down Expand Up @@ -34,8 +35,9 @@ def _export_block_by_table(inspect_db_session, block_number: int, table: str) ->
client = get_s3_client()
export_bucket_name = get_export_bucket_name()
export_statement = _get_export_statement(table)
date = round(datetime.utcnow().timestamp())

object_key = f"{table}/flashbots_{block_number}.json"
object_key = f"{table}/flashbots_{block_number}_{date}.json"

mev_summary_json_results = inspect_db_session.execute(
statement=export_statement,
Expand Down

0 comments on commit 7a0b21b

Please sign in to comment.