mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-02 11:52:38 +02:00
fix composio related sync scripts (#484)
This commit is contained in:
parent
80d134568c
commit
884b5d0414
2 changed files with 11 additions and 0 deletions
|
|
@ -442,6 +442,12 @@ async function performSyncComposio() {
|
||||||
const MAX_PAGES = 20;
|
const MAX_PAGES = 20;
|
||||||
|
|
||||||
for (let page = 0; page < MAX_PAGES; page++) {
|
for (let page = 0; page < MAX_PAGES; page++) {
|
||||||
|
// Re-check connection in case user disconnected mid-sync
|
||||||
|
if (!composioAccountsRepo.isConnected('googlecalendar')) {
|
||||||
|
console.log('[Calendar] Account disconnected during sync. Stopping.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const args: Record<string, unknown> = {
|
const args: Record<string, unknown> = {
|
||||||
calendar_id: 'primary',
|
calendar_id: 'primary',
|
||||||
time_min: timeMin,
|
time_min: timeMin,
|
||||||
|
|
|
||||||
|
|
@ -732,6 +732,11 @@ async function performSyncComposio() {
|
||||||
let highWaterMark: string | null = state?.last_sync ?? null;
|
let highWaterMark: string | null = state?.last_sync ?? null;
|
||||||
let processedCount = 0;
|
let processedCount = 0;
|
||||||
for (const threadId of allThreadIds) {
|
for (const threadId of allThreadIds) {
|
||||||
|
// Re-check connection in case user disconnected mid-sync
|
||||||
|
if (!composioAccountsRepo.isConnected('gmail')) {
|
||||||
|
console.log('[Gmail] Account disconnected during sync. Stopping.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const newestInThread = await processThreadComposio(connectedAccountId, threadId, SYNC_DIR);
|
const newestInThread = await processThreadComposio(connectedAccountId, threadId, SYNC_DIR);
|
||||||
processedCount++;
|
processedCount++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue