diff --git a/aleph/core.py b/aleph/core.py index 62a17cb10..c97e2db37 100644 --- a/aleph/core.py +++ b/aleph/core.py @@ -23,16 +23,12 @@ from werkzeug.local import LocalProxy from werkzeug.middleware.profiler import ProfilerMiddleware -from aleph import __version__ as aleph_version from aleph.settings import SETTINGS from aleph.cache import Cache from aleph.oauth import configure_oauth from aleph.util import LoggingTransport from aleph.metrics.flask import PrometheusExtension -import sentry_sdk -from sentry_sdk.integrations.flask import FlaskIntegration - NONE = "'none'" log = logging.getLogger(__name__) @@ -67,18 +63,6 @@ def create_app(config=None): config = {} configure_logging(level=logging.DEBUG) - - if SETTINGS.SENTRY_DSN: - sentry_sdk.init( - dsn=SETTINGS.SENTRY_DSN, - integrations=[ - FlaskIntegration(), - ], - traces_sample_rate=0, - release=aleph_version, - environment=SETTINGS.SENTRY_ENVIRONMENT, - send_default_pii=False, - ) app = Flask("aleph") app.config.from_object(SETTINGS) app.config.update(config) diff --git a/aleph/worker.py b/aleph/worker.py index 220ccaabe..da7b05157 100644 --- a/aleph/worker.py +++ b/aleph/worker.py @@ -157,7 +157,8 @@ def periodic(self): delete_expired_exports() delete_old_notifications() - self.run_indexing_batches() + if SETTINGS.STAGE_INDEX in SETTINGS.ALEPH_STAGES: + self.run_indexing_batches() except Exception: log.exception("Error while executing periodic tasks") diff --git a/aleph/wsgi.py b/aleph/wsgi.py index 17baf8255..96e9cea9c 100644 --- a/aleph/wsgi.py +++ b/aleph/wsgi.py @@ -1,3 +1,20 @@ from aleph.core import create_app +from aleph.settings import SETTINGS +from aleph import __version__ as aleph_version +import sentry_sdk +from sentry_sdk.integrations.flask import FlaskIntegration + + +if SETTINGS.SENTRY_DSN: + sentry_sdk.init( + dsn=SETTINGS.SENTRY_DSN, + integrations=[ + FlaskIntegration(), + ], + traces_sample_rate=0, + release=aleph_version, + environment=SETTINGS.SENTRY_ENVIRONMENT, + send_default_pii=False, + ) app = create_app() diff --git a/helm/charts/aleph/Chart.yaml b/helm/charts/aleph/Chart.yaml index f4dd384ec..df5a04952 100644 --- a/helm/charts/aleph/Chart.yaml +++ b/helm/charts/aleph/Chart.yaml @@ -3,4 +3,4 @@ name: aleph description: Helm chart for Aleph type: application version: 4.1.0-rc4 -appVersion: 4.1.0-rc4 +appVersion: 4.1.0-rc4 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 410e23c47..8aa8c15c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ followthemoney==3.5.9 followthemoney-store[postgresql]==3.1.0 followthemoney-compare==0.4.4 fingerprints==1.2.3 -servicelayer[google,amazon]==1.23.2 +servicelayer[google,amazon]==1.23.3-rc7 normality==2.5.0 pantomime==0.6.1 @@ -36,7 +36,7 @@ requests[security] >= 2.25.1, < 3.0.0 tabulate==0.9.0 zipstream-new==1.1.8 pika==1.3.2 -sentry-sdk[flask]==2.10.0 +sentry-sdk[flask]==2.19.2 prometheus-client==0.17.1