Skip to content

Commit 892d579

Browse files
committed
remove celery :(
1 parent 6ca7630 commit 892d579

7 files changed

Lines changed: 36 additions & 461 deletions

File tree

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
### Run project
2727

2828
🚀 Run project via `python manage.py runserver`
29-
Run celery worker via `celery -A procollab worker -l INFO -P eventlet`
30-
Run celery scheduler via `celery -A procollab beat`
3129
## For developers
3230

3331
### Install pre-commit hooks

mailing/tasks.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

poetry.lock

Lines changed: 1 addition & 399 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

procollab/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
from .celery import app as celery_app
2-
3-
__all__ = ["celery_app"]

procollab/celery.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

procollab/settings.py

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,6 @@
66
from decouple import config
77
from sentry_sdk.integrations.django import DjangoIntegration
88

9-
10-
# Celery Configuration Options
11-
CELERY_TIMEZONE = "Europe/Moscow"
12-
CELERY_TASK_TRACK_STARTED = True
13-
CELERY_TASK_TIME_LIMIT = 30 * 60
14-
CELERY_BROKER_URL = config(
15-
"CELERY_BROKER_URL", cast=str, default="redis://localhost:6379/0"
16-
)
17-
CELERY_RESULT_BACKEND = config("CELERY_RESULT_BACKEND", cast=str, default="redis")
18-
# CELERY_ACCEPT_CONTENT = ["application/json"]
19-
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
20-
21-
229
mimetypes.add_type("application/javascript", ".js", True)
2310
mimetypes.add_type("text/css", ".css", True)
2411
mimetypes.add_type("text/html", ".html", True)
@@ -138,7 +125,6 @@
138125
"core.log.middleware.CustomLoguruMiddleware",
139126
]
140127

141-
142128
# CORS_ALLOWED_ORIGINS = [
143129
# "http://localhost:4200",
144130
# "http://127.0.0.1:4200",
@@ -191,23 +177,7 @@
191177

192178
ASGI_APPLICATION = "procollab.asgi.application"
193179

194-
195180
REDIS_HOST = config("REDIS_HOST", cast=str, default="127.0.0.1")
196-
CHANNEL_LAYERS = {
197-
"default": {
198-
"BACKEND": "channels_redis.core.RedisChannelLayer",
199-
"CONFIG": {
200-
"hosts": [(REDIS_HOST, 6379)],
201-
},
202-
},
203-
}
204-
205-
CACHES = {
206-
"default": {
207-
"BACKEND": "django.core.cache.backends.redis.RedisCache",
208-
"LOCATION": f"redis://{REDIS_HOST}:6379",
209-
}
210-
}
211181

212182
if DEBUG:
213183
DATABASES = {
@@ -217,11 +187,46 @@
217187
}
218188
}
219189

190+
CACHES = {
191+
"default": {
192+
"BACKEND": "django_prometheus.cache.backends.filebased.FileBasedCache",
193+
"LOCATION": "/var/tmp/django_cache",
194+
}
195+
}
196+
197+
CHANNEL_LERS = {"default": {"BACKEND": "channels.layers.InMemoryChannelLayer"}}
220198
else:
199+
# fixme
200+
CACHES = {
201+
"default": {
202+
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
203+
}
204+
}
205+
206+
CHANNEL_LAYERS = {"default": {"BACKEND": "channels.layers.InMemoryChannelLayer"}}
207+
# CHANNEL_LAYERS = {
208+
# "default": {
209+
# "BACKEND": "channels_redis.core.RedisChannelLayer",
210+
# "CONFIG": {
211+
# "hosts": [("127.0.0.1", 6379)],
212+
# },
213+
# },
214+
# }
215+
#
216+
# REDIS_HOST = config("REDIS_HOST", cast=str, default="127.0.0.1")
217+
# CACHES = {
218+
# "default": {
219+
# "BACKEND": "django.core.cache.backends.redis.RedisCache",
220+
# "LOCATION": f"redis://{REDIS_HOST}:6379",
221+
# }
222+
# }
223+
221224
REST_FRAMEWORK["DEFAULT_RENDERER_CLASSES"] = [
222225
"rest_framework.renderers.JSONRenderer",
223226
]
227+
224228
DB_SERVICE = config("DB_SERVICE", default="postgres", cast=str)
229+
225230
DATABASES = {
226231
"default": {
227232
"ENGINE": "django_prometheus.db.backends.postgresql",
@@ -339,7 +344,6 @@
339344
"enqueue": True,
340345
}
341346

342-
343347
if DEBUG:
344348
SELECTEL_SWIFT_URL += "debug/"
345349

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ django-prometheus = "^2.3.1"
6161
loguru = "^0.7.1"
6262
tablib = {extras = ["xlsx"], version = "^3.5.0"}
6363
django-redis = "^5.3.0"
64-
celery = "^5.3.4"
65-
django-celery-beat = "^2.5.0"
66-
django-celery-results = "^2.5.1"
67-
eventlet = "^0.33.3"
6864

6965

7066
[build-system]

0 commit comments

Comments
 (0)