Skip to content

Commit

Permalink
🔧refactor: Set MySQL result backend as default
Browse files Browse the repository at this point in the history
  • Loading branch information
D10S0VSkY-OSS committed Nov 22, 2023
1 parent 327464a commit 557654b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sld-api-backend/config/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Settings(BaseSettings):
PASSWORD_LEN: int = os.getenv("SLD_PASSWORD_LEN", 8)
ROLLBACK: bool = os.getenv("SLD_ROLLBACK", False)
DEPLOY_TMOUT: int = os.getenv("SLD_DEPLOY_TMOUT", 7200)
GIT_TMOUT: int = os.getenv("SLD_GIT_TMOUT", 15)
GIT_TMOUT: int = os.getenv("SLD_GIT_TMOUT", 60)
WORKER_TMOUT: int = os.getenv("SLD_WORKER_TMOUT", 300)
ENV: str = os.getenv("SLD_ENV", "dev")
DEBUG: bool = os.getenv("SLD_DEBUG", False)
Expand Down
14 changes: 8 additions & 6 deletions sld-api-backend/config/celery_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
) # use por 6379 for redis or 5672 for RabbitMQ
BROKER_TYPE = os.getenv("BROKER_TYPE", "redis") # use amqp for RabbitMQ or redis
# Redus backend config
BACKEND_TYPE = os.getenv("BACKEND_TYPE", "redis")
BACKEND_USER = os.getenv("BACKEND_USER", "")
BACKEND_PASSWD = os.getenv("BACKEND_PASSWD", "")
BACKEND_SERVER = os.getenv("BACKEND_SERVER", "redis")
BACKEND_DB = os.getenv("BACKEND_DB", "0")
BACKEND_TYPE = os.getenv("BACKEND_TYPE", "db+mysql")
BACKEND_USER = os.getenv("BACKEND_USER", "root")
BACKEND_PASSWD = os.getenv("BACKEND_PASSWD", "123")
BACKEND_SERVER = os.getenv("BACKEND_SERVER", "db")
BACKEND_DB = os.getenv("BACKEND_DB", "restapi")

if not bool(os.getenv("DOCKER")): # if running example without docker
celery_app = Celery(
Expand All @@ -36,4 +36,6 @@
}

celery_app.conf.update(task_track_started=True)
celery_app.conf.result_expires = os.getenv("SLD_RESULT_EXPIRE", "259200")
celery_app.conf.update(result_extended=True)
celery_app.conf.broker_transport_options = {"visibility_timeout": 28800} # 8 hours.
celery_app.conf.result_expires = os.getenv("SLD_RESULT_EXPIRE", "259200")

0 comments on commit 557654b

Please sign in to comment.