Пример #1
0
from es import es
from eslog import eslog
# run afrer payment-account.py
S3_KEY_PREFIX = os.getenv("S3_KEY_PREFIX")
PLAYER_LOGIN_EVENT = os.getenv("PLAYER_LOGIN_EVENT")

ES_PAYING_USERS_INDEX = os.getenv("ES_PAYING_USERS_INDEX", "paying-users")
ES_ACTIVE_PAYING_USERS_INDEX = os.getenv("ES_ACTIVE_PAYING_USERS_INDEX",
                                         "active-paying-users")

# channel diff in CHANNELS
# upper or lower not in CHANNELS
CHANNELS = {"GOOGLE_PLAY": "google_store"}

bucket = None
logger = eslog.get_logger(ES_ACTIVE_PAYING_USERS_INDEX)


def valid_params():
    params_errors = []
    if util.is_empty(ES_PAYING_USERS_INDEX):
        params_errors.append("ES_PAYING_USERS_INDEX")

    if util.is_empty(S3_KEY_PREFIX):
        params_errors.append("S3_KEY_PREFIX")

    if util.is_empty(ES_ACTIVE_PAYING_USERS_INDEX):
        params_errors.append("ES_ACTIVE_PAYING_USERS_INDEX")

    if util.is_empty(PLAYER_LOGIN_EVENT):
        params_errors.append("PLAYER_LOGIN_EVENT")
Пример #2
0
from eslog import eslog
from util import util
from s3 import s3
from es import es
from model import PlayerIdMap

AWS_REGION = os.getenv("AWS_REGION")
S3_BUCKET = os.getenv("S3_BUCKET")
S3_KEY_PREFIX_CREATE_PLAYER = os.getenv("S3_KEY_PREFIX_CREATE_PLAYER")
S3_KEY_PREFIX_PLAYER_LOGIN = os.getenv("S3_KEY_PREFIX_PLAYER_LOGIN")
CREATE_PLAYER_EVENT = os.getenv("CREATE_PLAYER_EVENT")
PLAYER_LOGIN_EVENT = os.getenv("PLAYER_LOGIN_EVENT")
ES_INDEX = os.getenv("ES_INDEX", "retention")

logger = eslog.get_logger(ES_INDEX)
bucket = None


def valid_params():
    params_errors = []

    if util.is_empty(S3_KEY_PREFIX_CREATE_PLAYER):
        params_errors.append("S3_KEY_PREFIX_CREATE_PLAYER")

    if util.is_empty(S3_KEY_PREFIX_PLAYER_LOGIN):
        params_errors.append("S3_KEY_PREFIX_PLAYER_LOGIN")

    if util.is_empty(CREATE_PLAYER_EVENT):
        params_errors.append("CREATE_PLAYER_EVENT")