Skip to content

Commit

Permalink
send version as intified iso8601 date (#2616)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenoir authored Apr 23, 2024
1 parent 1a594a9 commit 74cfb7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ebsco_adapter/ebsco_adapter/src/test_update_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def test_update_notifier():
s3_bucket = "test_bucket"
xml_s3_prefix = "test_prefix"
topic_arn = "test_topic_arn"
notify_for_batch = "test_batch"
notify_for_batch = "2023-01-01"

fake_s3_client = FakeS3Client()
fake_sns_client = FakeSnsClient()
Expand Down Expand Up @@ -37,7 +37,7 @@ def test_update_notifier():
"bucket": s3_bucket,
"key": f"test_prefix/update-{i}.xml",
},
"version": 1,
"version": 20230101,
"deleted": False,
"sha256": "test_sha256",
}
Expand All @@ -48,7 +48,7 @@ def test_update_notifier():
{
"id": f"delete-{i}",
"location": None,
"version": 1,
"version": 20230101,
"deleted": True,
"sha256": None,
}
Expand Down
6 changes: 4 additions & 2 deletions ebsco_adapter/ebsco_adapter/src/update_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ def update_notifier(
update_messages = []
deleted_messages = []

version = int("".join(filter(str.isdigit, notify_for_batch)))

if updates["updated"] is not None:
for update_id, update in dict(updates["updated"]).items():
update_messages.append(
Expand All @@ -16,7 +18,7 @@ def update_notifier(
"bucket": s3_bucket,
"key": update["s3_key"],
},
"version": 1,
"version": version,
"deleted": False,
"sha256": update["sha256"],
}
Expand All @@ -28,7 +30,7 @@ def update_notifier(
{
"id": delete_id,
"location": None,
"version": 1,
"version": version,
"deleted": True,
"sha256": None,
}
Expand Down

0 comments on commit 74cfb7e

Please sign in to comment.