Skip to content

Commit

Permalink
Merge pull request #40 from meedan/cv2-3435-fix-queue-name
Browse files Browse the repository at this point in the history
CV2-3435 update env var, dedupe queue name
  • Loading branch information
DGaffney authored Oct 11, 2023
2 parents 6f65247 + 27d404a commit 62fa98e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env_file
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
QUEUE_PREFIX=dev_
PRESTO_PORT=8000
DEPLOY_ENV=local
# MODEL_NAME=mean_tokens.Model
Expand Down
3 changes: 1 addition & 2 deletions lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
def get_environment_setting(os_key: str) -> str:
"""
Get environment variable helper. Could be augmented with credential store if/when necessary.
Default to blank string as any .get on environ will result in string, so better to not create a None raise error
"""
return os.environ.get(os_key, "")
return os.environ.get(os_key)

def get_setting(current_value: Any, default_os_key: str) -> Any:
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/queue/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def create(cls, input_queue_name: str = None):
"""
queue_prefix = get_setting("", "QUEUE_PREFIX").replace(".", "__")
input_queue_name = queue_prefix+get_setting(input_queue_name, "MODEL_NAME").replace(".", "__")
output_queue_name = f"{queue_prefix}{input_queue_name}_output"
output_queue_name = f"{input_queue_name}_output"
logger.info(f"Starting queue with: ('{input_queue_name}', '{output_queue_name}')")
return QueueWorker(input_queue_name, output_queue_name)

Expand Down

0 comments on commit 62fa98e

Please sign in to comment.