icons, main .env
This commit is contained in:
+6
-6
@@ -292,23 +292,23 @@ def get_jobs(
|
||||
return [dict(row) for row in rows]
|
||||
|
||||
|
||||
def get_jobs_by_types(job_types, limit: int = 20):
|
||||
def get_jobs_by_target_ids(target_ids, limit: int = 20):
|
||||
run_migrations()
|
||||
job_types = list(job_types)
|
||||
if not job_types:
|
||||
target_ids = list(target_ids)
|
||||
if not target_ids:
|
||||
return []
|
||||
|
||||
con = get_connection()
|
||||
placeholders = ",".join("?" for _ in job_types)
|
||||
placeholders = ",".join("?" for _ in target_ids)
|
||||
rows = con.execute(
|
||||
f"""
|
||||
SELECT *
|
||||
FROM jobs
|
||||
WHERE type IN ({placeholders})
|
||||
WHERE target_id IN ({placeholders})
|
||||
ORDER BY id DESC
|
||||
LIMIT ?
|
||||
""",
|
||||
(*job_types, limit),
|
||||
(*target_ids, limit),
|
||||
).fetchall()
|
||||
|
||||
con.close()
|
||||
|
||||
Reference in New Issue
Block a user