Skip to content

Commit

Permalink
Merge 78b1cfa into b4c552c
Browse files Browse the repository at this point in the history
  • Loading branch information
king-alexander committed Feb 1, 2023
2 parents b4c552c + 78b1cfa commit 84a57ae
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ x-admiral-template: &admiral-template
dockerfile: Dockerfile-admiral
deploy:
mode: replicated
replicas: 6
replicas: 5
environment:
ADMIRAL_CONFIG_FILE: "/run/secrets/admiral.yml"
ADMIRAL_CONFIG_SECTION: dev-mode
Expand Down
32 changes: 21 additions & 11 deletions secrets/admiral.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ celery-defaults: &celery-defaults
result_backend: redis://:fruitcake@redis:6379/0
result_expires: 3600
task_acks_late: true
task_reject_on_worker_lost: true
task_track_started: true
task_send_sent_event: true
task_default_queue: cyhy_default
task_default_exchange: null
task_routes:
admiral.certs.*:
queue: cyhy_cert_work
admiral.port_scan.*:
queue: cyhy_scanner_work
admiral.tester.*:
queue: cyhy_test_work
task_default_queue: cyhy_default
task_queues:
cyhy_cert_work:
routing_key: cyhy_cert_work
cyhy_scanner_work:
routing_key: cyhy_scanner_work
cyhy_test_work:
routing_key: cyhy_test_work
task_reject_on_worker_lost: true
task_routes:
admiral.certs.*:
queue: cyhy_cert_work
admiral.port_scan.*:
queue: cyhy_scanner_work
admiral.tester.*:
queue: cyhy_test_work
task_send_sent_event: true
task_track_started: true

# used in the development container
dev-mode:
Expand All @@ -37,9 +37,19 @@ dev-mode:
- admiral.port_scan
- admiral.tester

task_rate_limit: &task_rate_limit
# Modify the rate below as needed. Limits are applied per worker, so
# "2/h" means limit one worker to 2 tasks per hour. To get the global
# rate limit, you must multiply by the number of workers provisioned.
# For more syntax examples, refer to
# https://docs.celeryq.dev/en/stable/userguide/tasks.html#Task.rate_limit
rate_limit: "2/h"

cert-worker: &default-section
celery:
<<: *celery-defaults
task_annotations:
tasks.summary_by_domain: *task_rate_limit
task_default_queue: cyhy_cert_work
task_queues:
cyhy_cert_work:
Expand Down
2 changes: 1 addition & 1 deletion src/admiral/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""This file defines the version of this module."""
__version__ = "1.2.0"
__version__ = "1.3.0"
1 change: 0 additions & 1 deletion src/admiral/certs/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

@shared_task(
autoretry_for=(Exception, requests.HTTPError, requests.exceptions.HTTPError),
rate_limit="10/h",
retry_backoff=True,
retry_jitter=True,
retry_kwargs={"max_retries": 16},
Expand Down

0 comments on commit 84a57ae

Please sign in to comment.