diff --git a/.socialgouv/environments/preprod/yaml/importData.yaml b/.socialgouv/environments/preprod/yaml/importData.yaml index 34cb7cf0..72642106 100644 --- a/.socialgouv/environments/preprod/yaml/importData.yaml +++ b/.socialgouv/environments/preprod/yaml/importData.yaml @@ -6,7 +6,7 @@ metadata: labels: app: mon-psy spec: - schedule: "*/5 * * * *" + schedule: "0 */1 * * *" jobTemplate: spec: template: diff --git a/package.json b/package.json index 47227314..203ccada 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@faker-js/faker": "^6.0.0-alpha.6", "@sentry/nextjs": "^6.17.9", "@socialgouv/bootstrap.core": "^0.2.1", - "@socialgouv/matomo-next": "^1.2.2", + "@socialgouv/matomo-next": "^1.3.0", "@types/sequelize": "^4.28.11", "@typescript-eslint/eslint-plugin": "^5.11.0", "axios": "^0.26.0", diff --git a/sentry.client.config.ts b/sentry.client.config.ts index c16f4478..f62351c7 100644 --- a/sentry.client.config.ts +++ b/sentry.client.config.ts @@ -1,7 +1,7 @@ import * as Sentry from "@sentry/nextjs"; -const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; -const SENTRY_ENV = process.env.SENTRY_ENV || process.env.NEXT_PUBLIC_SENTRY_ENV; +const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN; +const SENTRY_ENV = process.env.NEXT_PUBLIC_SENTRY_ENV; Sentry.init({ dsn: SENTRY_DSN ?? "", diff --git a/sentry.server.config.ts b/sentry.server.config.ts index c16f4478..f62351c7 100644 --- a/sentry.server.config.ts +++ b/sentry.server.config.ts @@ -1,7 +1,7 @@ import * as Sentry from "@sentry/nextjs"; -const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; -const SENTRY_ENV = process.env.SENTRY_ENV || process.env.NEXT_PUBLIC_SENTRY_ENV; +const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN; +const SENTRY_ENV = process.env.NEXT_PUBLIC_SENTRY_ENV; Sentry.init({ dsn: SENTRY_DSN ?? "", diff --git a/src/cron/demarchesSimplifiees.ts b/src/cron/demarchesSimplifiees.ts index 90ab9665..eb97c369 100644 --- a/src/cron/demarchesSimplifiees.ts +++ b/src/cron/demarchesSimplifiees.ts @@ -1,11 +1,11 @@ import * as Sentry from "@sentry/nextjs"; -import { models } from "../../src/db/models"; +import { models } from "../db/models"; import { getPsychologistList, getPsychologistState, -} from "../../src/services/demarchesSimplifiees/import"; -import { saveMany, updateState } from "../../src/services/psychologists"; +} from "../services/demarchesSimplifiees/import"; +import { saveMany, updateState } from "../services/psychologists"; export const importData = async (): Promise => { try { diff --git a/src/cron/launch.ts b/src/cron/launch.ts index 31fe5360..dc3707a2 100644 --- a/src/cron/launch.ts +++ b/src/cron/launch.ts @@ -4,10 +4,12 @@ import * as demarchesSimplifiees from "./demarchesSimplifiees"; const runJob = async (job): Promise => { const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN; + const SENTRY_ENV = process.env.NEXT_PUBLIC_SENTRY_ENV; console.log(`Initializing Sentry with url: ${SENTRY_DSN}`); Sentry.init({ dsn: SENTRY_DSN, + environment: SENTRY_ENV ?? "development", }); await job();