build: replace celery with procrastinate

This commit is contained in:
Herculino Trotta
2024-10-11 14:11:40 -03:00
parent c9ae8c9db5
commit 49db2089e8
18 changed files with 32 additions and 190 deletions
-3
View File
@@ -1,3 +0,0 @@
from .celery import app as celery_app
__all__ = ("celery_app",)
-7
View File
@@ -1,7 +0,0 @@
import os
from celery import Celery
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WYGIWYH.settings")
app = Celery("WYGIWYH")
app.config_from_object("django.conf:settings", namespace="CELERY")
app.autodiscover_tasks()
+1 -8
View File
@@ -56,7 +56,7 @@ INSTALLED_APPS = [
"django_tables2",
"django_filters",
"apps.users.apps.UsersConfig",
"django_celery_beat",
"procrastinate.contrib.django",
"apps.transactions.apps.TransactionsConfig",
"apps.currencies.apps.CurrenciesConfig",
"apps.accounts.apps.AccountsConfig",
@@ -199,13 +199,6 @@ LOGIN_URL = "/login/"
CRISPY_ALLOWED_TEMPLATE_PACKS = ["bootstrap5", "crispy_forms/pure_text"]
CRISPY_TEMPLATE_PACK = "bootstrap5"
# Celery settings
CELERY_BROKER_URL = os.getenv("CELERY_BROKER_URL", "redis://redis")
CELERY_RESULT_BACKEND = os.getenv("CELERY_BROKER_URL", "redis://redis")
REDIS_URL = os.getenv("CELERY_BROKER_URL", "redis://redis")
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
SESSION_COOKIE_AGE = int(os.getenv("SESSION_EXPIRY_TIME", 2678400)) # 31 days
SESSION_COOKIE_SECURE = os.getenv("HTTPS_ENABLED", "false").lower() == "true"
+1 -1
View File
@@ -18,7 +18,7 @@ from apps.transactions.models import Transaction
@only_htmx
@login_required
@require_http_methods(["GET", "POST"])
def transaction_add(request, **kwargs):
def transaction_add(request):
month = int(request.GET.get("month", timezone.localdate(timezone.now()).month))
year = int(request.GET.get("year", timezone.localdate(timezone.now()).year))
transaction_type = Transaction.Type(request.GET.get("type", "IN"))