0

added bull auth key

This commit is contained in:
rafaelsideguide 2024-06-11 17:52:01 -03:00
parent a9f93c2f1e
commit 157fbe4a1e
2 changed files with 5 additions and 2 deletions

View File

@ -3,13 +3,16 @@ on:
schedule: schedule:
- cron: '0 0 * * *' - cron: '0 0 * * *'
env:
BULL_AUTH_KEY: ${{ secrets.BULL_AUTH_KEY }}
jobs: jobs:
clean-jobs: clean-jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Send GET request to clean jobs - name: Send GET request to clean jobs
run: | 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 if [ "$response" -ne 200 ]; then
echo "Failed to clean jobs. Response: $response" echo "Failed to clean jobs. Response: $response"
exit 1 exit 1

View File

@ -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 { try {
const webScraperQueue = getWebScraperQueue(); const webScraperQueue = getWebScraperQueue();
const completedJobs = await webScraperQueue.getJobs(['completed']); const completedJobs = await webScraperQueue.getJobs(['completed']);