task logs: migrate from filesystem to postgresql; refactor sidecars into submodules
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
updateEmailAccountStatus,
|
||||
} from 'officerdb';
|
||||
import { validateImapConnection } from './imap-validate';
|
||||
import * as sidecar from '../../sidecar-registry';
|
||||
import { enqueueJob, listAllJobs } from '../../queue/init';
|
||||
|
||||
type CreateAccountBody = {
|
||||
provider: string;
|
||||
@@ -44,7 +44,7 @@ accountsRouter.get('/', async (ctx) => {
|
||||
|
||||
if (hasActiveAccounts) {
|
||||
try {
|
||||
const jobs = await sidecar.listJobs();
|
||||
const jobs = await listAllJobs();
|
||||
activeJobAccountIds = new Set(
|
||||
jobs
|
||||
.filter((j) => j.type === 'email-sync' && (j.status === 'queued' || j.status === 'running'))
|
||||
@@ -148,7 +148,7 @@ accountsRouter.post('/:id/sync', async (ctx) => {
|
||||
// Set status immediately so the UI reflects the queued state
|
||||
await updateEmailAccountStatus(id, 'queued');
|
||||
|
||||
const job = await sidecar.enqueueJob({
|
||||
const job = await enqueueJob({
|
||||
lane: 'email',
|
||||
type: 'email-sync',
|
||||
userId: user.email,
|
||||
|
||||
Reference in New Issue
Block a user