Skip to content

Commit

Permalink
Use verb version of cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-z committed Aug 19, 2024
1 parent a800e0a commit f6b915d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def handle_data(self, data):

@asynccontextmanager
async def lifespan(app: FastAPI):
scheduler.add_job(cleanup, trigger=CronTrigger.from_crontab("* * * * *"))
scheduler.add_job(clean_up, trigger=CronTrigger.from_crontab("* * * * *"))
scheduler.add_job(commit, trigger=CronTrigger.from_crontab("* * * * *"))
yield
scheduler.shutdown()
Expand Down Expand Up @@ -214,8 +214,8 @@ def confirm(mailing_list: str, email: str, code: str):
}


@app.post("/cleanup")
def cleanup():
@app.post("/clean-up")
def clean_up():
"""
Clean up expired signups.
"""
Expand All @@ -235,7 +235,7 @@ def cleanup():

app.runtime_info["num_expired_signups"] += deleted_count
app.runtime_info["last_cleanup_time"] = time.time()
msg = f"cleanup: Deleted {deleted_count} expired signup(s)."
msg = f"clean_up: Deleted {deleted_count} expired signup(s)."
logger.info(msg)
return {"status": "ok", "message": msg}

Expand Down

0 comments on commit f6b915d

Please sign in to comment.