Fix hanging document mailbox imports
This commit is contained in:
@@ -29,6 +29,7 @@ export default async function documentImportRoutes(server: FastifyInstance) {
|
||||
lastSyncedAt: row.lastSyncedAt,
|
||||
lastError: row.lastError,
|
||||
createdAt: row.createdAt,
|
||||
...server.services.documentImports.getSyncStatus(row.id),
|
||||
})
|
||||
|
||||
server.get("/document-imports", async (req) => {
|
||||
@@ -101,7 +102,10 @@ export default async function documentImportRoutes(server: FastifyInstance) {
|
||||
|
||||
server.post("/document-imports/:id/sync", async (req, reply) => {
|
||||
try {
|
||||
return await server.services.documentImports.syncSource(tenantId(req), (req.params as { id: string }).id)
|
||||
return reply.code(202).send(server.services.documentImports.startSync(
|
||||
tenantId(req),
|
||||
(req.params as { id: string }).id,
|
||||
))
|
||||
} catch (error: any) {
|
||||
return reply.code(400).send({ error: error?.message || "Synchronisierung fehlgeschlagen" })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user