delete操作不触发 rebuild cache

This commit is contained in:
pengtao 2019-10-09 15:21:40 +08:00
parent 129ceb6ac0
commit c4eda03bf0
2 changed files with 2 additions and 8 deletions

View File

@ -226,10 +226,7 @@ class Ad(Resource):
del_sql = f"update ad set in_used=0 where id={id};"
try:
self.mydb.change(del_sql)
if rebuild_ad():
return jsonify({'code': 200, 'message': f'remove adid={id} success!'})
else:
return jsonify({'code': 500, 'message': 'rebuild cache failed!'})
except Exception:
log.error("remove id from ad failed!", exc_info=True)

View File

@ -158,10 +158,7 @@ class Location(Resource):
try:
del_sql = f'update location set in_used=0 where id={id};'
self.mydb.change(del_sql)
if rebuild_ad():
return jsonify({'code': 200})
else:
return jsonify({'code': 500})
except Exception:
log.error(f"location remove {id} failed!", exc_info=True)
return jsonify({'code': 500})