delete操作不触发 rebuild cache
This commit is contained in:
parent
129ceb6ac0
commit
c4eda03bf0
@ -226,10 +226,7 @@ class Ad(Resource):
|
|||||||
del_sql = f"update ad set in_used=0 where id={id};"
|
del_sql = f"update ad set in_used=0 where id={id};"
|
||||||
try:
|
try:
|
||||||
self.mydb.change(del_sql)
|
self.mydb.change(del_sql)
|
||||||
if rebuild_ad():
|
|
||||||
return jsonify({'code': 200, 'message': f'remove adid={id} success!'})
|
return jsonify({'code': 200, 'message': f'remove adid={id} success!'})
|
||||||
else:
|
|
||||||
return jsonify({'code': 500, 'message': 'rebuild cache failed!'})
|
|
||||||
except Exception:
|
except Exception:
|
||||||
log.error("remove id from ad failed!", exc_info=True)
|
log.error("remove id from ad failed!", exc_info=True)
|
||||||
|
|
||||||
|
@ -158,10 +158,7 @@ class Location(Resource):
|
|||||||
try:
|
try:
|
||||||
del_sql = f'update location set in_used=0 where id={id};'
|
del_sql = f'update location set in_used=0 where id={id};'
|
||||||
self.mydb.change(del_sql)
|
self.mydb.change(del_sql)
|
||||||
if rebuild_ad():
|
|
||||||
return jsonify({'code': 200})
|
return jsonify({'code': 200})
|
||||||
else:
|
|
||||||
return jsonify({'code': 500})
|
|
||||||
except Exception:
|
except Exception:
|
||||||
log.error(f"location remove {id} failed!", exc_info=True)
|
log.error(f"location remove {id} failed!", exc_info=True)
|
||||||
return jsonify({'code': 500})
|
return jsonify({'code': 500})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user