diff --git a/ad_interface_tornado.py b/ad_interface_tornado.py index 20abd46..e40d7f2 100644 --- a/ad_interface_tornado.py +++ b/ad_interface_tornado.py @@ -111,7 +111,7 @@ class DispatchHandler(tornado.web.RequestHandler): self.write({'errcode': 1, "errmsg": 'get adid failed!'}) if adid: - key = f"{adid}::num" + key = f"ad::{adid}::num" my_redis.incr(key) self.write({'errcode': 0, "errmsg": '', "message": f"{adid} incr success!"}) diff --git a/config.py b/config.py index 0703910..e72867a 100644 --- a/config.py +++ b/config.py @@ -1,10 +1,18 @@ # -*- coding: utf-8 -*- import os -expire_time = 7200 +ad_env = os.getenv('ad_env') ad_mysql_pwd = os.getenv('adpwd') -redis_company_config = {'host': '10.10.4.8', 'port': 6379, 'db': 1, 'passwd': 'crs-9ltb97ds:i33dkxshh'} -mysql_promotion_config = {'user': 'ad', 'pswd': ad_mysql_pwd, 'host': '10.10.3.5', 'db': 'ad'} + +if ad_env == 'prod': + redis_company_config = {'host': '10.10.4.8', 'port': 6379, 'db': 1, 'passwd': 'crs-9ltb97ds:i33dkxshh'} + mysql_promotion_config = {'user': 'ad', 'pswd': ad_mysql_pwd, 'host': '10.10.3.5', 'db': 'ad'} +elif ad_env == 'dev': + redis_company_config = {'host': '192.168.100.20', 'port': 6379, 'db': 2, 'passwd': ''} + mysql_promotion_config = {'user': 'miles', 'pswd': 'aspect', 'host': '192.168.100.30', 'db': 'test'} + +expire_time = 7200 + ad_list_interface_port = 5014 BEGIN = '1999-01-01' END = '3000-01-01'