Skip to content

Commit 4e6fecc

Browse files
Properly track last_update
1 parent fe7298d commit 4e6fecc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

runner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ def _poll(
2727
api_url: str,
2828
params: typing.Dict[str, str],
2929
last_update: str,
30-
) -> None:
30+
) -> str:
3131
params = {**params, "since": last_update}
3232

3333
with requests.get(api_url, params=params) as resp:
3434
resp.raise_for_status()
3535
data = resp.json()
3636
logging.info("GITHUB: %s %s", resp.status_code, resp.reason)
3737

38-
tracker_path.write_text(_now())
38+
last_update = _now()
39+
tracker_path.write_text(last_update)
3940

4041
if len(data) > 0:
4142
# new commits.
@@ -92,6 +93,8 @@ def _poll(
9293
else:
9394
logging.info("No new commits, going to sleep")
9495

96+
return last_update
97+
9598

9699
@click.command()
97100
@click.argument("webhook_url", envvar="DAPI_TRACKER_WEBHOOK_URL")

0 commit comments

Comments
 (0)