Skip to content

Commit

Permalink
Disable ping worker, use docker instead
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptobench committed Aug 21, 2024
1 parent 88d2cb1 commit b40a71e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
52 changes: 26 additions & 26 deletions docker-stack/docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,32 +162,32 @@ services:
condition: any
networks:
- reputation
ping_worker:
command:
[
"/bin/sh",
"-c",
"/wait-for-it.sh ${POSTGRES_DB} -- /reputation-backend/start.sh; celery -A core worker -l INFO -Q pinger -c 1",
]
image: ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:latest
env_file:
- ./.envs/.django
healthcheck:
test: /check_yagna.sh || exit 1
interval: 15s
timeout: 5s
retries: 3
start_period: 15s
deploy:
replicas: 1
update_config:
parallelism: 1
failure_action: rollback
delay: 10s
restart_policy:
condition: any
networks:
- reputation
# ping_worker:
# command:
# [
# "/bin/sh",
# "-c",
# "/wait-for-it.sh ${POSTGRES_DB} -- /reputation-backend/start.sh; celery -A core worker -l INFO -Q pinger -c 1",
# ]
# image: ghcr.io/golemfactory/golem-reputation-backend-celery-yagna:latest
# env_file:
# - ./.envs/.django
# healthcheck:
# test: /check_yagna.sh || exit 1
# interval: 15s
# timeout: 5s
# retries: 3
# start_period: 15s
# deploy:
# replicas: 1
# update_config:
# parallelism: 1
# failure_action: rollback
# delay: 10s
# restart_policy:
# condition: any
# networks:
# - reputation
celery_beat:
image: ghcr.io/golemfactory/golem-reputation-backend-celery-beat:latest
command: celery -A core beat -l INFO
Expand Down
2 changes: 1 addition & 1 deletion docker-stack/golem-reputation-backend/p2p-ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async def ping_providers(p2p):

# Run the script continuously
async def main():
p2p = True # Adjust this as needed
p2p = os.environ.get('P2P', 'false').lower() == 'true'
while True:
await ping_providers(p2p)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ def setup_periodic_tasks(sender, **kwargs):
queue="default",
options={"queue": "default", "routing_key": "default"},
)
sender.add_periodic_task(
30.0,
ping_providers_task.s(p2p=False),
queue="pinger",
options={"queue": "pinger", "routing_key": "pinger"},
)
# sender.add_periodic_task( Not needed anymore, separate docker task now.
# 30.0,
# ping_providers_task.s(p2p=False),
# queue="pinger",
# options={"queue": "pinger", "routing_key": "pinger"},
# )
sender.add_periodic_task(
30.0,
process_offers_from_redis.s(),
Expand Down

0 comments on commit b40a71e

Please sign in to comment.