添加环境变量判断
This commit is contained in:
parent
987550c263
commit
f8ee128bfd
@ -112,7 +112,7 @@ class DispatchHandler(tornado.web.RequestHandler):
|
|||||||
|
|
||||||
if adid:
|
if adid:
|
||||||
key = f"ad::{adid}::num"
|
key = f"ad::{adid}::num"
|
||||||
my_redis.incr(key)
|
my_redis.incr(key, amount=1)
|
||||||
self.write({'errcode': 0, "errmsg": '', "message": f"{adid} incr success!"})
|
self.write({'errcode': 0, "errmsg": '', "message": f"{adid} incr success!"})
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,8 @@ if ad_env == 'prod':
|
|||||||
elif ad_env == 'dev':
|
elif ad_env == 'dev':
|
||||||
redis_company_config = {'host': '192.168.100.20', 'port': 6379, 'db': 2, 'passwd': ''}
|
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'}
|
mysql_promotion_config = {'user': 'miles', 'pswd': 'aspect', 'host': '192.168.100.30', 'db': 'test'}
|
||||||
|
else:
|
||||||
|
raise Exception("GET config with mysql/redis failed!")
|
||||||
|
|
||||||
expire_time = 7200
|
expire_time = 7200
|
||||||
|
|
||||||
|
@ -17,9 +17,9 @@ app = Flask(__name__)
|
|||||||
api = Api(app)
|
api = Api(app)
|
||||||
|
|
||||||
# 设置路由
|
# 设置路由
|
||||||
api.add_resource(Company, '/company')
|
api.add_resource(Company, '/interface/company')
|
||||||
api.add_resource(Location, '/location')
|
api.add_resource(Location, '/interface/location')
|
||||||
api.add_resource(Ad, '/ad')
|
api.add_resource(Ad, '/interface/ad')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host='0.0.0.0', debug=True, port=5015)
|
app.run(host='0.0.0.0', debug=True, port=5015)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user