aboutsummaryrefslogtreecommitdiff
path: root/jb/config.py
blob: c7d07e568e26cf308cf4abe220bbce253b6ab40d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import logging

from generalresearchutils.config import is_debug

from jb.settings import get_settings, get_test_settings

if is_debug():
    print("running using TEST settings")
    settings = get_test_settings()
    assert settings.debug is True
else:
    print("running using PROD settings")
    settings = get_settings()
    assert settings.debug is False

if settings.debug:
    LOG_LEVEL = logging.DEBUG
else:
    LOG_LEVEL = logging.WARNING

# The SNS topic that 1) JB Mturk will send notifications to, 2) will make http POSTs
#   back to us (here)
TOPIC_ARN = f"arn:aws:sns:us-east-2:{settings.aws_owner_id}:amt-jb"
SUBSCRIPTION = {
    "SubscriptionArn": settings.aws_subscription_arn,
    "Owner": settings.aws_owner_id,
    "Protocol": "https",
    "Endpoint": f"https://jamesbillings67.com/{settings.sns_path}/",
    "TopicArn": TOPIC_ARN,
}

JB_EVENTS_STREAM = "amt_jb_events"
JB_EVENTS_FAILED_STREAM = "amt_jb_events_failed"
CONSUMER_GROUP = "amt-jb-0"
# We'll only have 1 consumer atm, change this if we don't
CONSUMER_NAME = "amt-jb-0"