Skip to content

Commit

Permalink
added bull auth key
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsideguide committed Jun 11, 2024
1 parent a9f93c2 commit 157fbe4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/clean-before-24h-complete-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit 157fbe4

Please sign in to comment.