diff --git a/src/modules/api/submodules/p2p.ts b/src/modules/api/submodules/p2p.ts index a5abcd1..4540f3f 100644 --- a/src/modules/api/submodules/p2p.ts +++ b/src/modules/api/submodules/p2p.ts @@ -693,7 +693,12 @@ function setup(data: SubmoduleData): Submodule { logger.Log( `\tSyncing: ${ - syncAll ? 'everything' : Object.keys(syncAll).join(', ') + syncAll + ? 'everything' + : Object.entries(shouldSync) + .filter(([_key, value]) => value) + .map(([key]) => key) + .join(', ') }`, 'green' ) @@ -719,7 +724,7 @@ function setup(data: SubmoduleData): Submodule { }) logger.Log(`\tLast sync with peers:`) logger.logTable([['', 'Date'], ...lastSyncInfos], { - colWidth: [15], + colWidth: [20], rowPrefix: '\t', }) @@ -827,13 +832,13 @@ function setup(data: SubmoduleData): Submodule { const syncResults: SyncResult[] = [] const userData = getData('users') - if (userData) { + if (userData && userData.length > 0) { const res = await syncUsers(userData, syncStart) syncResults.push(res) } const questionData = getData('questions') - if (userData) { + if (questionData && questionData.length > 0) { const res = await syncQuestions(questionData, syncStart) syncResults.push(res) } @@ -915,7 +920,7 @@ function setup(data: SubmoduleData): Submodule { ['Added total', newUserCount - oldUserCount], ['Final', newUserCount], ], - { colWidth: [15], rowPrefix: '\t' } + { colWidth: [20], rowPrefix: '\t' } ) } logger.Log(`Successfully synced users!`, 'green') @@ -975,7 +980,7 @@ function setup(data: SubmoduleData): Submodule { logger.logTable( [['', 'QDBs', 'Subjs', 'Questions'], ...recievedDataCounts], { - colWidth: [15], + colWidth: [20], rowPrefix: '\t', } ) @@ -1105,7 +1110,7 @@ function setup(data: SubmoduleData): Submodule { ], ['Final', newQuestionDbCount, newSubjCount, newQuestionCount], ], - { colWidth: [15], rowPrefix: '\t' } + { colWidth: [20], rowPrefix: '\t' } ) logger.Log(`Successfully synced questions!`, 'green')