Skip to content

Commit

Permalink
fix: [AAP-36058] correct the default log_timestamp of RulebookProcess…
Browse files Browse the repository at this point in the history
…Log records (#1160)
  • Loading branch information
hsong-rh authored Dec 6, 2024
1 parent 76918e5 commit eab474a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/aap_eda/services/activation/db_log_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def write(
):
self.flush()

# set default value of log_timestamp
if log_timestamp == 0:
log_timestamp = int(datetime.now().timestamp())

if not isinstance(lines, list):
lines = [lines]

Expand Down
2 changes: 2 additions & 0 deletions tests/integration/services/activation/engine/test_podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def test_engine_start(

engine.client.containers.run.assert_called_once()
assert models.RulebookProcessLog.objects.count() == 4
for log in models.RulebookProcessLog.objects.all():
assert log.log_timestamp > 0
assert models.RulebookProcessLog.objects.last().log.endswith("is running.")


Expand Down

0 comments on commit eab474a

Please sign in to comment.