@@ -296,25 +296,25 @@ async function updateSharedSyncs(
296296 }
297297}
298298
299- export async function getLastSharedSyncTimes ( boardName : BoardName , tableNames = SHARED_SYNC_TABLES ) {
299+ export async function getLastSharedSyncTimes ( boardName : BoardName ) {
300300 const sharedSyncsSchema = getTable ( 'sharedSyncs' , boardName ) ;
301301
302302 const result = await db
303303 . select ( {
304304 table_name : sharedSyncsSchema . tableName ,
305305 last_synchronized_at : sharedSyncsSchema . lastSynchronizedAt ,
306306 } )
307- . from ( sharedSyncsSchema )
308- . where ( inArray ( sharedSyncsSchema . tableName , tableNames as unknown as Array < string > ) ) ;
307+ . from ( sharedSyncsSchema ) ;
309308
310309 return result ;
311310}
312311
313312export async function syncSharedData (
314313 board : BoardName ,
315314) : Promise < Record < string , { synced : number } > > {
316- const allSyncTimes = await getLastSharedSyncTimes ( board , SHARED_SYNC_TABLES ) ;
317-
315+ console . log ( 'Entered sync shared data' ) ;
316+ const allSyncTimes = await getLastSharedSyncTimes ( board ) ;
317+ console . log ( 'Fetched previous sync times' ) ;
318318 const syncParams : SyncOptions = {
319319 tables : [ ...SHARED_SYNC_TABLES ] ,
320320 sharedSyncs : allSyncTimes . map ( ( syncTime ) => ( {
@@ -326,6 +326,7 @@ export async function syncSharedData(
326326 const syncResults = await sharedSync ( board , syncParams ) ;
327327
328328 console . log ( `Received ${ syncResults . PUT . climbs . length } climbs and ${ syncResults . PUT . climb_stats . length } climb_stats` ) ;
329+
329330 return upsertAllSharedTableData ( board , syncResults ) ;
330331}
331332
0 commit comments