From 157fbe4a1ea67e4807426696b5f9b3de446641c8 Mon Sep 17 00:00:00 2001 From: rafaelsideguide <150964962+rafaelsideguide@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:52:01 -0300 Subject: [PATCH] added bull auth key --- .github/workflows/clean-before-24h-complete-jobs.yml | 5 ++++- apps/api/src/index.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clean-before-24h-complete-jobs.yml b/.github/workflows/clean-before-24h-complete-jobs.yml index 2fd3b22..2ced537 100644 --- a/.github/workflows/clean-before-24h-complete-jobs.yml +++ b/.github/workflows/clean-before-24h-complete-jobs.yml @@ -3,13 +3,16 @@ on: schedule: - cron: '0 0 * * *' +env: + BULL_AUTH_KEY: ${{ secrets.BULL_AUTH_KEY }} + jobs: clean-jobs: runs-on: ubuntu-latest steps: - name: Send GET request to clean jobs run: | - response=$(curl --write-out '%{http_code}' --silent --output /dev/null https://api.firecrawl.dev/clean-before-24h-complete-jobs) + response=$(curl --write-out '%{http_code}' --silent --output /dev/null https://api.firecrawl.dev/admin/${{ secrets.BULL_AUTH_KEY }}/clean-before-24h-complete-jobs) if [ "$response" -ne 200 ]; then echo "Failed to clean jobs. Response: $response" exit 1 diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index eac8204..cc8376b 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -164,7 +164,7 @@ app.get('/serverHealthCheck/notify', async (req, res) => { } }); -app.get('/clean-before-24h-complete-jobs', async (req, res) => { +app.get(`/admin/${process.env.BULL_AUTH_KEY}/clean-before-24h-complete-jobs`, async (req, res) => { try { const webScraperQueue = getWebScraperQueue(); const completedJobs = await webScraperQueue.getJobs(['completed']);