mirror of
https://github.com/System-End/nephthys.git
synced 2026-04-19 20:55:09 +00:00
maybe some things will actually close as stale now lmao
This commit is contained in:
parent
ef7a827a53
commit
919890ca8d
1 changed files with 12 additions and 12 deletions
|
|
@ -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}")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue