feat: db constistancy
This commit is contained in:
@@ -37,6 +37,17 @@ async def fetch_placement_post_cycle(self: 'Usecase', interval_seconds: int) ->
|
||||
).first()
|
||||
|
||||
if matching_post:
|
||||
# Validate channel consistency
|
||||
if matching_post.channel_id != placement.placement_channel_id:
|
||||
log.error(
|
||||
'Post %s channel_id mismatch: expected %s, got %s. Skipping placement %s',
|
||||
matching_post.id,
|
||||
placement.placement_channel_id,
|
||||
matching_post.channel_id,
|
||||
placement.id,
|
||||
)
|
||||
continue
|
||||
|
||||
placement.post = matching_post
|
||||
await placement.save()
|
||||
updated_count += 1
|
||||
|
||||
Reference in New Issue
Block a user