Clear finished jobs' steps a minute after they end
Job steps (bots_queue_updates) only feed the live working row, so the new clear-job-steps cron deletes them shortly after a job ends, however it ended, keeping their count on bots_queue.steps for the message details. Not done the moment a job ends: the live relay would miss the last ones. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+6
-1
@@ -1106,6 +1106,11 @@ const schema: BUN_SQLITE_DatabaseSchemaType = {
|
||||
fieldDescription: `Unix timestamp of completion or final failure`,
|
||||
dataType: "INTEGER",
|
||||
},
|
||||
{
|
||||
fieldName: "steps",
|
||||
fieldDescription: `How many steps it recorded, written when its \`bots_queue_updates\` are cleared after it ends (null while they're still there)`,
|
||||
dataType: "INTEGER",
|
||||
},
|
||||
],
|
||||
indexes: [
|
||||
{
|
||||
@@ -1116,7 +1121,7 @@ const schema: BUN_SQLITE_DatabaseSchemaType = {
|
||||
},
|
||||
{
|
||||
tableName: "bots_queue_updates",
|
||||
tableDescription: `What a bot did while working through a queued job, one row per step, oldest first. Live in the working-on panel while the job runs; deleted with the job when it's pruned`,
|
||||
tableDescription: `What a bot did while working through a queued job, one row per step, oldest first. Live in the working-on panel while the job runs; cleared shortly after the job ends (clearFinishedJobSteps), its count kept on the job`,
|
||||
fields: [
|
||||
{
|
||||
fieldName: "bots_queue_id",
|
||||
|
||||
+6
-2
@@ -505,11 +505,11 @@ export type BUN_SQLITE_COBBLE_TASKS = {
|
||||
*/
|
||||
updated_at?: number | "";
|
||||
/**
|
||||
* The bot the task belongs to; null for a workspace's task
|
||||
* The bot that has the task: its own list's, or with `workspace_id` its task in that workspace; null for a workspace's shared task nobody has yet
|
||||
*/
|
||||
bot_id?: number | "";
|
||||
/**
|
||||
* The workspace the task belongs to (its bots all see it); null for a bot's own
|
||||
* The workspace the task is in; null for a bot's own list
|
||||
*/
|
||||
workspace_id?: number | "";
|
||||
title?: string;
|
||||
@@ -679,6 +679,10 @@ export type BUN_SQLITE_COBBLE_BOTS_QUEUE = {
|
||||
* Unix timestamp of completion or final failure
|
||||
*/
|
||||
finished_at?: number | "";
|
||||
/**
|
||||
* How many steps it recorded, written when its `bots_queue_updates` are cleared after it ends (null while they're still there)
|
||||
*/
|
||||
steps?: number | "";
|
||||
/**
|
||||
* The state of the job. (pending | processing | completed | failed)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user