mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
remove useless code
This commit is contained in:
parent
72d8c343b4
commit
77eb98a344
1 changed files with 1 additions and 8 deletions
|
@ -12,7 +12,6 @@ import sys
|
||||||
import coloredlogs
|
import coloredlogs
|
||||||
import requests
|
import requests
|
||||||
from utils import Dirty, DirtyDelta
|
from utils import Dirty, DirtyDelta
|
||||||
from sentry_sdk import configure_scope
|
|
||||||
|
|
||||||
logging.getLogger().disabled = True
|
logging.getLogger().disabled = True
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -39,12 +38,6 @@ def update_block(session: db.Session, block: list, delay: float = 0, change_call
|
||||||
try:
|
try:
|
||||||
change = item.update(session=session)
|
change = item.update(session=session)
|
||||||
except requests.exceptions.HTTPError as e:
|
except requests.exceptions.HTTPError as e:
|
||||||
with configure_scope() as scope:
|
|
||||||
if str(e.response.status_code).startswith("5"):
|
|
||||||
scope.level = "warning"
|
|
||||||
logger.warning(f"Server error {sys.exc_info()} while updating {repr(item)}.")
|
|
||||||
else:
|
|
||||||
scope.level = "error"
|
|
||||||
logger.error(f"Error {sys.exc_info()} while updating {repr(item)}.")
|
logger.error(f"Error {sys.exc_info()} while updating {repr(item)}.")
|
||||||
sentry.extra_context({
|
sentry.extra_context({
|
||||||
"item": repr(item),
|
"item": repr(item),
|
||||||
|
|
Loading…
Reference in a new issue