maybe some things will actually close as stale now lmao

This commit is contained in:
transcental 2025-07-16 12:58:47 +01:00
parent ef7a827a53
commit 919890ca8d

View file

@ -62,21 +62,21 @@ async def close_stale_tickets():
"openedBy": True, "openedBy": True,
}, },
) )
stale_tickets = [ stale = 0
ticket for ticket in tickets if await get_is_stale(ticket.msgTs)
]
for ticket in stale_tickets: for ticket in tickets:
await resolve( if await get_is_stale(ticket.msgTs):
ticket.msgTs, stale += 1
ticket.openedBy.slackId, # type: ignore (this is valid - see include above) await resolve(
env.slack_client, ticket.msgTs,
stale=True, ticket.openedBy.slackId, # type: ignore (this is valid - see include above)
) env.slack_client,
stale=True,
)
await send_heartbeat(f"Closed {len(stale_tickets)} stale tickets.") await send_heartbeat(f"Closed {stale} stale tickets.")
logging.info(f"Closed {len(stale_tickets)} stale tickets.") logging.info(f"Closed {stale} stale tickets.")
except Exception as e: except Exception as e:
logging.error(f"Error closing stale tickets: {e}") logging.error(f"Error closing stale tickets: {e}")
await send_heartbeat(f"Error closing stale tickets: {e}") await send_heartbeat(f"Error closing stale tickets: {e}")