Skip to content

Commit 7a5b566

Browse files
committed
Fix bugs
1 parent 2fe5173 commit 7a5b566

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ env:
2525
jobs:
2626
build:
2727
runs-on: ubuntu-latest
28-
strategy:
29-
fail-fast: true
30-
matrix:
31-
platform:
32-
- linux/amd64
33-
- linux/arm64/v8
34-
- linux/386
3528
permissions:
3629
contents: read
3730
packages: write
@@ -79,4 +72,4 @@ jobs:
7972
labels: ${{ steps.meta.outputs.labels }}
8073
cache-from: type=gha
8174
cache-to: type=gha,mode=max
82-
platforms: ${{ matrix.platform }}
75+
platforms: linux/amd64,linux/arm64/v8,linux/386

src/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ async def url_worker():
125125
await session.execute(update(URL).where(URL.id == next_job.url.id).values(last_seen=saved_dt))
126126
await session.execute(update(Job).where(Job.id == next_job.id).values(completed=saved_dt))
127127
break
128-
except Exception as e:
129-
raise e
128+
except Exception:
129+
pass
130+
await asyncio.sleep(10)
130131
else: # Ran out of retries, try again
131132
async with session.begin():
132133
if next_job.retry < 4:
@@ -154,6 +155,7 @@ async def repeat_url_worker():
154155
# batch = await Batch.objects.create()
155156
batch = Batch()
156157
created_at = curtime
158+
session.add(batch)
157159
queued.append(Job(url=job.url, priority=10, batches=[batch, job.batch]))
158160
if queued:
159161
session.add_all(queued)

0 commit comments

Comments
 (0)