d
This commit is contained in:
@@ -234,7 +234,7 @@
|
||||
"ddl\\.to/([0-9a-zA-Z]{12})"
|
||||
],
|
||||
"regexp": "((ddownload\\.com/[0-9a-zA-Z]{12}))|(ddl\\.to/([0-9a-zA-Z]{12}))",
|
||||
"status": true
|
||||
"status": false
|
||||
},
|
||||
"dropapk": {
|
||||
"name": "dropapk",
|
||||
|
||||
@@ -2508,34 +2508,25 @@ class API_folder_store:
|
||||
)
|
||||
return False
|
||||
|
||||
payload = text if text.endswith("\n") else f"{text}\n"
|
||||
cursor = self.connection.cursor()
|
||||
cursor.execute(
|
||||
"SELECT stdout FROM worker WHERE worker_id = ?",
|
||||
(worker_id,
|
||||
)
|
||||
"""
|
||||
UPDATE worker
|
||||
SET stdout = CASE
|
||||
WHEN stdout IS NULL OR stdout = '' THEN ?
|
||||
WHEN substr(stdout, -1, 1) = '\n' THEN stdout || ?
|
||||
ELSE stdout || '\n' || ?
|
||||
END,
|
||||
last_updated = CURRENT_TIMESTAMP,
|
||||
last_stdout_at = CURRENT_TIMESTAMP
|
||||
WHERE worker_id = ?
|
||||
""",
|
||||
(payload, payload, payload, worker_id),
|
||||
)
|
||||
row = cursor.fetchone()
|
||||
|
||||
if not row:
|
||||
if cursor.rowcount <= 0:
|
||||
logger.warning(f"Worker {worker_id} not found for stdout append")
|
||||
return False
|
||||
|
||||
current_stdout = row[0] or ""
|
||||
separator = (
|
||||
"" if not current_stdout else
|
||||
("" if current_stdout.endswith("\n") else "\n")
|
||||
)
|
||||
new_stdout = f"{current_stdout}{separator}{text}\n"
|
||||
|
||||
cursor.execute(
|
||||
"""
|
||||
UPDATE worker SET stdout = ?, last_updated = CURRENT_TIMESTAMP,
|
||||
last_stdout_at = CURRENT_TIMESTAMP
|
||||
WHERE worker_id = ?
|
||||
""",
|
||||
(new_stdout,
|
||||
worker_id),
|
||||
)
|
||||
self._insert_worker_log_entry(
|
||||
cursor,
|
||||
worker_id,
|
||||
|
||||
Reference in New Issue
Block a user