style: format merged scheduler and db changes

This commit is contained in:
Eyejoker
2026-03-20 03:48:48 +09:00
parent 6eb72ad499
commit f3283f0314
4 changed files with 18 additions and 12 deletions

View File

@@ -504,7 +504,6 @@ export class DiscordChannel implements Channel {
return groupType === this.agentTypeFilter; return groupType === this.agentTypeFilter;
} }
async disconnect(): Promise<void> { async disconnect(): Promise<void> {
if (this.client) { if (this.client) {
this.client.destroy(); this.client.destroy();

View File

@@ -437,9 +437,7 @@ describe('task CRUD', () => {
expect(getDueTasks('claude-code').map((task) => task.id)).toEqual([ expect(getDueTasks('claude-code').map((task) => task.id)).toEqual([
'task-claude', 'task-claude',
]); ]);
expect(getDueTasks('codex').map((task) => task.id)).toEqual([ expect(getDueTasks('codex').map((task) => task.id)).toEqual(['task-codex']);
'task-codex',
]);
}); });
}); });

View File

@@ -117,13 +117,17 @@ function createSchema(database: Database.Database): void {
} }
try { try {
database.exec(`ALTER TABLE scheduled_tasks ADD COLUMN status_message_id TEXT`); database.exec(
`ALTER TABLE scheduled_tasks ADD COLUMN status_message_id TEXT`,
);
} catch { } catch {
/* column already exists */ /* column already exists */
} }
try { try {
database.exec(`ALTER TABLE scheduled_tasks ADD COLUMN status_started_at TEXT`); database.exec(
`ALTER TABLE scheduled_tasks ADD COLUMN status_started_at TEXT`,
);
} catch { } catch {
/* column already exists */ /* column already exists */
} }
@@ -637,7 +641,9 @@ export function updateTask(
export function updateTaskStatusTracking( export function updateTaskStatusTracking(
id: string, id: string,
updates: Partial<Pick<ScheduledTask, 'status_message_id' | 'status_started_at'>>, updates: Partial<
Pick<ScheduledTask, 'status_message_id' | 'status_started_at'>
>,
): void { ): void {
const fields: string[] = []; const fields: string[] = [];
const values: unknown[] = []; const values: unknown[] = [];

View File

@@ -124,7 +124,9 @@ export function renderWatchCiStatusMessage(args: {
}): string { }): string {
const target = extractWatchCiTarget(args.task.prompt) || 'CI watcher'; const target = extractWatchCiTarget(args.task.prompt) || 'CI watcher';
const title = const title =
args.phase === 'completed' ? `CI 감시 종료: ${target}` : `CI 감시 중: ${target}`; args.phase === 'completed'
? `CI 감시 종료: ${target}`
: `CI 감시 중: ${target}`;
const statusLabel = const statusLabel =
args.phase === 'checking' args.phase === 'checking'
? '확인 중' ? '확인 중'
@@ -361,7 +363,10 @@ async function runTask(
if (!currentTask) { if (!currentTask) {
await updateWatcherStatus('completed'); await updateWatcherStatus('completed');
logger.debug({ taskId: task.id }, 'Task deleted during execution, skipping persistence'); logger.debug(
{ taskId: task.id },
'Task deleted during execution, skipping persistence',
);
return; return;
} }
@@ -402,9 +407,7 @@ export function startSchedulerLoop(deps: SchedulerDependencies): void {
const loop = async () => { const loop = async () => {
try { try {
const dueTasks = getDueTasks( const dueTasks = getDueTasks(deps.serviceAgentType || SERVICE_AGENT_TYPE);
deps.serviceAgentType || SERVICE_AGENT_TYPE,
);
if (dueTasks.length > 0) { if (dueTasks.length > 0) {
logger.info({ count: dueTasks.length }, 'Found due tasks'); logger.info({ count: dueTasks.length }, 'Found due tasks');
} }