Skip to content

Commit

Permalink
Prevent the night log comment sequence from getting out of sync
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Nov 1, 2024
1 parent 9bfad66 commit 40f26be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lvmapi/tools/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ async def add_night_log_comment(
raise RuntimeError("Cannot get next comment pk.")
comment_pk = fetch_pk[0] + 1

# Increase the sequence to make sure it doesn't get out of sync.
await acursor.execute(
"ALTER SEQUENCE gortdb.night_log_comment_pk_seq INCREMENT BY 1;"
)

# Now add the comment.
try:
await acursor.execute(
Expand Down

0 comments on commit 40f26be

Please sign in to comment.