Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #379 from alphagov/emit-write-messages
Browse files Browse the repository at this point in the history
Use write API config for celery tasks
  • Loading branch information
timmow committed Dec 3, 2014
2 parents 70e8ba6 + 514362a commit 0efb380
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
15 changes: 14 additions & 1 deletion backdrop/transformers/tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
from worker import app
from celery import Celery

# Load the appropriate config from backdrop.write
import importlib
from os import getenv

GOVUK_ENV = getenv("GOVUK_ENV", "development")
config = importlib.import_module(
"backdrop.write.config.{}".format(GOVUK_ENV))

app = Celery(
'transformations',
broker=config.TRANSFORMER_AMQP_URL,
include=['backdrop.transformers.tasks'])


@app.task(ignore_result=True)
Expand Down
2 changes: 2 additions & 0 deletions backdrop/write/config/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
STAGECRAFT_DATA_SET_QUERY_TOKEN = 'dev-data-set-query-token'

SIGNON_API_USER_TOKEN = 'development-oauth-access-token'

TRANSFORMER_AMQP_URL = 'amqp://transformer:notarealpw@localhost:5672/%2Ftransformations'
1 change: 1 addition & 0 deletions backdrop/write/config/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"data_set_with_timestamp_auto_id": ["_timestamp", "key"],
"evl_volumetrics": ["_timestamp", "service", "transaction"],
}
TRANSFORMER_AMQP_URL = 'memory://'

from development import (STAGECRAFT_COLLECTION_ENDPOINT_TOKEN, STAGECRAFT_URL,
STAGECRAFT_DATA_SET_QUERY_TOKEN, SIGNON_API_USER_TOKEN)
Expand Down

0 comments on commit 0efb380

Please sign in to comment.