diff --git a/Dockerfile b/Dockerfile index c54bf9c8..7376bbb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -276,7 +276,6 @@ RUN --mount=type=cache,id=apt-lib-cache,sharing=locked,target=/var/lib/apt \ pkgconf \ python3 \ python3-wheel \ - redis-server \ curl \ less \ && \ diff --git a/Pipfile b/Pipfile index 08c20163..b0aad1e4 100644 --- a/Pipfile +++ b/Pipfile @@ -20,7 +20,5 @@ django-basicauth = "*" psycopg2-binary = "*" mysqlclient = "*" yt-dlp = "*" -redis = "*" -hiredis = "*" requests = {extras = ["socks"], version = "*"} emoji = "*" diff --git a/config/root/etc/redis/redis.conf b/config/root/etc/redis/redis.conf deleted file mode 100644 index 8e411e80..00000000 --- a/config/root/etc/redis/redis.conf +++ /dev/null @@ -1,46 +0,0 @@ -bind 127.0.0.1 -protected-mode yes -port 6379 -tcp-backlog 511 -timeout 0 -tcp-keepalive 300 -daemonize no -supervised no -loglevel notice -logfile "" -databases 1 -always-show-logo no -save "" -dir /var/lib/redis -maxmemory 64mb -maxmemory-policy noeviction -lazyfree-lazy-eviction no -lazyfree-lazy-expire no -lazyfree-lazy-server-del no -replica-lazy-flush no -lazyfree-lazy-user-del no -oom-score-adj no -oom-score-adj-values 0 200 800 -appendonly no -appendfsync no -lua-time-limit 5000 -slowlog-log-slower-than 10000 -slowlog-max-len 128 -latency-monitor-threshold 0 -notify-keyspace-events "" -hash-max-ziplist-entries 512 -hash-max-ziplist-value 64 -list-max-ziplist-size -2 -list-compress-depth 0 -set-max-intset-entries 512 -zset-max-ziplist-entries 128 -zset-max-ziplist-value 64 -hll-sparse-max-bytes 3000 -stream-node-max-bytes 4096 -stream-node-max-entries 100 -activerehashing yes -client-output-buffer-limit normal 0 0 0 -client-output-buffer-limit replica 256mb 64mb 60 -client-output-buffer-limit pubsub 32mb 8mb 60 -hz 10 -dynamic-hz yes diff --git a/config/root/etc/s6-overlay/s6-rc.d/celery-beat/dependencies b/config/root/etc/s6-overlay/s6-rc.d/celery-beat/dependencies deleted file mode 100644 index 283e1305..00000000 --- a/config/root/etc/s6-overlay/s6-rc.d/celery-beat/dependencies +++ /dev/null @@ -1 +0,0 @@ -gunicorn \ No newline at end of file diff --git a/config/root/etc/s6-overlay/s6-rc.d/celery-beat/run b/config/root/etc/s6-overlay/s6-rc.d/celery-beat/run deleted file mode 100755 index 46b03a67..00000000 --- a/config/root/etc/s6-overlay/s6-rc.d/celery-beat/run +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/with-contenv bash - -UMASK_SET=${UMASK_SET:-022} -umask "$UMASK_SET" - -cd /app || exit - -PIDFILE=/run/app/celery-beat.pid -SCHEDULE=/tmp/tubesync-celerybeat-schedule - -if [ -f "${PIDFILE}" ] -then - PID=$(cat $PIDFILE) - echo "Unexpected PID file exists at ${PIDFILE} with PID: ${PID}" - if kill -0 $PID - then - echo "Killing old gunicorn process with PID: ${PID}" - kill -9 $PID - fi - echo "Removing stale PID file: ${PIDFILE}" - rm ${PIDFILE} -fi - -#exec s6-setuidgid app \ -# /usr/local/bin/celery --workdir /app -A tubesync beat --pidfile ${PIDFILE} -s ${SCHEDULE} diff --git a/config/root/etc/s6-overlay/s6-rc.d/celery-beat/type b/config/root/etc/s6-overlay/s6-rc.d/celery-beat/type deleted file mode 100644 index 1780f9f4..00000000 --- a/config/root/etc/s6-overlay/s6-rc.d/celery-beat/type +++ /dev/null @@ -1 +0,0 @@ -longrun \ No newline at end of file diff --git a/config/root/etc/s6-overlay/s6-rc.d/celery-worker/dependencies b/config/root/etc/s6-overlay/s6-rc.d/celery-worker/dependencies deleted file mode 100644 index 283e1305..00000000 --- a/config/root/etc/s6-overlay/s6-rc.d/celery-worker/dependencies +++ /dev/null @@ -1 +0,0 @@ -gunicorn \ No newline at end of file diff --git a/config/root/etc/s6-overlay/s6-rc.d/celery-worker/run b/config/root/etc/s6-overlay/s6-rc.d/celery-worker/run deleted file mode 100755 index 04e2a32c..00000000 --- a/config/root/etc/s6-overlay/s6-rc.d/celery-worker/run +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/with-contenv bash - -UMASK_SET=${UMASK_SET:-022} -umask "$UMASK_SET" - -cd /app || exit - -PIDFILE=/run/app/celery-worker.pid - -if [ -f "${PIDFILE}" ] -then - PID=$(cat $PIDFILE) - echo "Unexpected PID file exists at ${PIDFILE} with PID: ${PID}" - if kill -0 $PID - then - echo "Killing old gunicorn process with PID: ${PID}" - kill -9 $PID - fi - echo "Removing stale PID file: ${PIDFILE}" - rm ${PIDFILE} -fi - -#exec s6-setuidgid app \ -# /usr/local/bin/celery --workdir /app -A tubesync worker --pidfile ${PIDFILE} -l INFO diff --git a/config/root/etc/s6-overlay/s6-rc.d/celery-worker/type b/config/root/etc/s6-overlay/s6-rc.d/celery-worker/type deleted file mode 100644 index 1780f9f4..00000000 --- a/config/root/etc/s6-overlay/s6-rc.d/celery-worker/type +++ /dev/null @@ -1 +0,0 @@ -longrun \ No newline at end of file diff --git a/config/root/etc/s6-overlay/s6-rc.d/redis/dependencies b/config/root/etc/s6-overlay/s6-rc.d/redis/dependencies deleted file mode 100644 index e69de29b..00000000 diff --git a/config/root/etc/s6-overlay/s6-rc.d/redis/run b/config/root/etc/s6-overlay/s6-rc.d/redis/run deleted file mode 100755 index 09edec81..00000000 --- a/config/root/etc/s6-overlay/s6-rc.d/redis/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/command/with-contenv bash - -exec s6-setuidgid redis \ - /usr/bin/redis-server /etc/redis/redis.conf diff --git a/config/root/etc/s6-overlay/s6-rc.d/redis/type b/config/root/etc/s6-overlay/s6-rc.d/redis/type deleted file mode 100644 index 1780f9f4..00000000 --- a/config/root/etc/s6-overlay/s6-rc.d/redis/type +++ /dev/null @@ -1 +0,0 @@ -longrun \ No newline at end of file diff --git a/tubesync/tubesync/celery.py b/tubesync/tubesync/celery.py deleted file mode 100644 index aad3092f..00000000 --- a/tubesync/tubesync/celery.py +++ /dev/null @@ -1,19 +0,0 @@ -import os -from celery import Celery - - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tubesync.settings') -REDIS_CONNECTION = os.getenv('REDIS_CONNECTION', 'redis://localhost:6379/0') - - -app = Celery('tubesync') -app.config_from_object('django.conf:settings', namespace='CELERY') -app.autodiscover_tasks() -app.conf.broker_url = REDIS_CONNECTION -app.conf.beat_schedule = { - '10-second-beat': { - 'task': 'sync.tasks.housekeeping_task', - 'schedule': 60.0, - 'args': () - }, -}