fix: repr WoodpeckerEvent?!

This commit is contained in:
Piotr Dec 2026-04-14 03:26:17 +02:00
parent 7234560d16
commit 239e51f0f8
Signed by: stawros
GPG key ID: 74B18A3F0F1E99C0

View file

@ -23,16 +23,19 @@ class ReloadService:
logger.info("ReloadService initialized.")
async def on_reload(self, event: ReloadEvent):
logger.info(f"Received ReloadEvent: {event.service}")
head = self._git.get_head()
mos = Path(f"files/{event.service}").glob('*.mo.*')
we = WoodpeckerEvent(
_id=-1,
commit=head.sha,
ref=head.branch,
message=f"Manual reload of {event.service}",
started=int(datetime.now().timestamp()),
files=[f"compose/{event.service}/docker-compose.yml"] + [str(pp) for pp in list(mos)]
)
logger.trace(f"Sending <WoodpeckerEvent _id={we._id} commit={we.commit} ref={we.ref} message={we.message} started={we.started} files={we.files}")
await self._bus.dispatch(we)
try:
logger.info(f"Received ReloadEvent: {event.service}")
head = self._git.get_head()
mos = Path(f"files/{event.service}").glob('*.mo.*')
we = WoodpeckerEvent(
_id=-1,
commit=head.sha,
ref=head.branch,
message=f"Manual reload of {event.service}",
started=int(datetime.now().timestamp()),
files=[f"compose/{event.service}/docker-compose.yml"] + [str(pp) for pp in list(mos)]
)
logger.debug(f"Sending <WoodpeckerEvent _id={we._id} commit={we.commit} ref={we.ref} message={we.message} started={we.started} files={we.files}")
await self._bus.dispatch(we)
except Exception as e:
logger.error(f"Reload error: {e}", exc_info=True)