diff --git a/handler/ad.py b/handler/ad.py index fae0a77..5f7b93b 100644 --- a/handler/ad.py +++ b/handler/ad.py @@ -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!'}) + return jsonify({'code': 200, 'message': f'remove adid={id} success!'}) except Exception: log.error("remove id from ad failed!", exc_info=True) diff --git a/handler/location.py b/handler/location.py index 1ff45ba..6d2d2e9 100644 --- a/handler/location.py +++ b/handler/location.py @@ -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}) + return jsonify({'code': 200}) except Exception: log.error(f"location remove {id} failed!", exc_info=True) return jsonify({'code': 500})