detecting already inserted entries

This commit is contained in:
msramalho
2023-12-13 14:59:51 +00:00
parent 74f93ef856
commit 496a3651e5
2 changed files with 4 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ load_dotenv()
# Configuration
ALLOWED_ORIGINS = os.environ.get("ALLOWED_ORIGINS", "chrome-extension://ondkcheoicfckabcnkdgbepofpjmjcmb,chrome-extension://ojcimmjndnlmmlgnjaeojoebaceokpdp").split(",")
VERSION = "0.5.11"
VERSION = "0.5.12"
# min-version refers to the version of auto-archiver-extension on the webstore
BREAKING_CHANGES = {"minVersion": "0.3.1", "message": "The latest update has breaking changes, please update the extension to the most recent version."}

View File

@@ -13,7 +13,7 @@ from db.database import SessionLocal
from contextlib import contextmanager
import json
from sqlite3 import IntegrityError
from sqlalchemy import exc
celery = Celery(__name__)
celery.conf.broker_url = os.environ.get("CELERY_BROKER_URL", "redis://localhost:6379")
@@ -77,13 +77,11 @@ def create_sheet_task(self, sheet_json: str):
try:
insert_result_into_db(result, sheet.tags, sheet.public, sheet.group_id, sheet.author_id, models.generate_uuid())
stats["archived"] += 1
except IntegrityError as e:
# cache was used, so we skip
except exc.IntegrityError as e:
logger.warning(f"cached result detected: {e}")
logger.warning(traceback.format_exc())
stats["archived"] += 1
pass
except Exception as e:
logger.error(type(e))
logger.error(e)
logger.error(traceback.format_exc())
stats["failed"] += 1