Skip to content

Commit

Permalink
on conflict do nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
gvelez17 committed May 28, 2024
1 parent b592d02 commit bf20fac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions logs-to-tsdb/backfill/get-all-days.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def get_query_results(query_id, filename):
def main():
log_group = "/ecs/ceramic-prod-cas"

start_date_str = "2024-05-22 10:00:00"
end_date_str = "2024-05-22 23:59:00"
start_date_str = "2024-05-22 23:59:00"
end_date_str = "2024-05-23 08:00:00"
start_date = datetime.strptime(start_date_str, "%Y-%m-%d %H:%M:%S").replace(tzinfo=timezone.utc)
end_date = datetime.strptime(end_date_str, "%Y-%m-%d %H:%M:%S").replace(tzinfo=timezone.utc)

Expand Down
2 changes: 1 addition & 1 deletion logs-to-tsdb/kinesis-lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def handler(event, context):
batched.append((ts, log_data['cid'], log_data['did'], log_data.get('model'), log_data.get('family'), log_data.get('stream'), log_data.get('origin'), log_data.get('cacao'), log_data.get('cap_cid')))

# Insert logs into TimescaleDB
insert_query = "INSERT INTO cas_log_data (timestamp, cid, did, model, family, stream, origin, cacao, cap_cid) VALUES %s"
insert_query = "INSERT INTO cas_log_data (timestamp, cid, did, model, family, stream, origin, cacao, cap_cid) VALUES %s on CONFLICT DO NOTHING"

if batched:
print("Inserting {} rows".format(len(batched)))
Expand Down

0 comments on commit bf20fac

Please sign in to comment.