From 9ed3c1f0428807b517b56dc10eca38880edb097c Mon Sep 17 00:00:00 2001 From: hmacdope Date: Fri, 20 Sep 2024 16:10:20 +1000 Subject: [PATCH] fix --- falcbot/falcbot.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/falcbot/falcbot.py b/falcbot/falcbot.py index 0799bf7..b5cfc57 100644 --- a/falcbot/falcbot.py +++ b/falcbot/falcbot.py @@ -9,12 +9,16 @@ from asapdiscovery.ml.models import ASAPMLModelRegistry import llm import util - +import schedule +import time # logger in a global context logging.basicConfig(level=logging.DEBUG) +# update the registry every 4 hours +schedule.every(4).hour.do(ASAPMLModelRegistry.update_registry()) + class SlackSettings(BaseSettings): SLACK_BOT_TOKEN: str = Field( @@ -60,8 +64,6 @@ def pred_matcher(event, logger, context): @app.event("app_mention", matchers=[pred_matcher]) def make_pic50_pred(event, say, context, logger): - # refresh the registry every time a prediction is made - ASAPMLModelRegistry.update_registry() content = event.get("text") # parse with LLM