From f453bcf17c87f526fa4e140e2f874b7db470288f Mon Sep 17 00:00:00 2001 From: rafaelsideguide <150964962+rafaelsideguide@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:51:20 -0300 Subject: [PATCH] bugfix docker self hosting --- apps/api/src/services/logging/crawl_log.ts | 10 ++++++---- docker-compose.yaml | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/api/src/services/logging/crawl_log.ts b/apps/api/src/services/logging/crawl_log.ts index 76a06072..1224bd44 100644 --- a/apps/api/src/services/logging/crawl_log.ts +++ b/apps/api/src/services/logging/crawl_log.ts @@ -2,8 +2,9 @@ import { supabase_service } from "../supabase"; import "dotenv/config"; export async function logCrawl(job_id: string, team_id: string) { - try { - const { data, error } = await supabase_service + if (process.env.USE_DB_AUTHENTICATION === 'true') { + try { + const { data, error } = await supabase_service .from("bulljobs_teams") .insert([ { @@ -11,7 +12,8 @@ export async function logCrawl(job_id: string, team_id: string) { team_id: team_id, }, ]); - } catch (error) { - console.error("Error logging crawl job:\n", error); + } catch (error) { + console.error("Error logging crawl job:\n", error); + } } } diff --git a/docker-compose.yaml b/docker-compose.yaml index b1de4330..b88f3ed8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -56,6 +56,7 @@ services: - redis - playwright-service - api + command: [ "pnpm", "run", "workers" ] redis: image: redis:alpine