开启日志用于调试

This commit is contained in:
pengtao 2019-10-09 19:38:49 +08:00
parent e23b5a264b
commit 36c8c779f5

View File

@ -207,12 +207,14 @@ class Ad(Resource):
if data: if data:
condition = f"id='{self.args['id']}'" condition = f"id='{self.args['id']}'"
self.mydb.update("ad", ad, condition) self.mydb.update("ad", ad, condition)
time.sleep(1) if ad['status'] == 1:
if rebuild_ad(): if rebuild_ad():
log.info(f"rebuild cache via ad change!") log.info(f"rebuild cache via ad change!")
return jsonify({'code': 200, 'message': 'update adid={id} success!'}) return jsonify({'code': 200, 'message': 'update adid={id} success!'})
else:
return jsonify({'code': 500, 'message': 'rebuild cache failed!'})
else: else:
return jsonify({'code': 500, 'message': 'rebuild cache failed!'}) return jsonify({'code': 200, 'message': 'update adid={id} success!'})
else: else:
return jsonify({'code': 404, 'message': f"{self.args['id']} not found in mysql!"}) return jsonify({'code': 404, 'message': f"{self.args['id']} not found in mysql!"})
except Exception: except Exception: