From c4eda03bf0f4f37a973349ccda926d32604a9af5 Mon Sep 17 00:00:00 2001 From: pengtao Date: Wed, 9 Oct 2019 15:21:40 +0800 Subject: [PATCH] =?UTF-8?q?delete=E6=93=8D=E4=BD=9C=E4=B8=8D=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=20rebuild=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/ad.py | 5 +---- handler/location.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) 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})