fixes
This commit is contained in:
22
sync-test.ts
22
sync-test.ts
@@ -9,15 +9,27 @@ dotenv.config({ path: '.env' });
|
||||
|
||||
console.log('DATABASE_URL:', process.env.DATABASE_URL);
|
||||
console.log('AWS_REGION:', process.env.AWS_REGION);
|
||||
console.log('AWS_ACCESS_KEY_ID:', process.env.AWS_ACCESS_KEY_ID ? 'Set' : 'Not set'); // Maskiere sensible Keys
|
||||
console.log('AWS_ACCESS_KEY_ID:', process.env.AWS_ACCESS_KEY_ID ? 'Set' : 'Not set');
|
||||
console.log('AWS_SECRET_ACCESS_KEY:', process.env.AWS_SECRET_ACCESS_KEY ? 'Set' : 'Not set');
|
||||
|
||||
// Timeout-Wrapper für den Sync
|
||||
async function runSyncWithTimeout(timeoutMs = 600000) { // 10 Minuten Standard-Timeout
|
||||
return Promise.race([
|
||||
syncAllDomains(),
|
||||
new Promise((_, reject) =>
|
||||
setTimeout(() => reject(new Error('Sync timeout exceeded')), timeoutMs)
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
console.log('Starting sync...');
|
||||
await syncAllDomains();
|
||||
console.log('Sync done');
|
||||
console.log('Starting sync with timeout...');
|
||||
await runSyncWithTimeout();
|
||||
console.log('Sync completed successfully');
|
||||
process.exit(0);
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
console.error('Sync error:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user