Initial commit
This commit is contained in:
parent
387bc056b9
commit
df8c2313a9
275 changed files with 12939 additions and 263 deletions
21
delete-crawl-jobs.py
Normal file
21
delete-crawl-jobs.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import requests
|
||||
import time
|
||||
|
||||
base_url = "http://localhost:5001/api/v1/jobs"
|
||||
|
||||
response = requests.get(base_url)
|
||||
jobs = response.json() # Direkt Array
|
||||
print(f"{len(jobs)} Jobs gefunden.")
|
||||
|
||||
deleted = 0
|
||||
for job in jobs:
|
||||
job_id = job["ID"]
|
||||
del_res = requests.delete(f"{base_url}/{job_id}")
|
||||
if del_res.status_code in [200, 204]:
|
||||
print(f"✓ {job_id}")
|
||||
deleted += 1
|
||||
else:
|
||||
print(f"✗ {job_id}: {del_res.status_code}")
|
||||
time.sleep(0.1)
|
||||
|
||||
print(f"{deleted}/{len(jobs)} gelöscht.")
|
||||
Loading…
Add table
Add a link
Reference in a new issue