fix(wasabi): reload S3 client after saving credentials (403 persistia com chave antiga em memória)
continuous-integration/webhook Deploy concluído (VPS4)
continuous-integration/webhook Deploy concluído (VPS4)
This commit is contained in:
@@ -185,6 +185,10 @@ router.post('/storage-config', async (req, res) => {
|
||||
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, updated_at = NOW()
|
||||
`, [configJson]);
|
||||
|
||||
// 3. CRÍTICO: recarregar a config no processo em execução, senão o cliente S3
|
||||
// em memória continua usando as credenciais antigas (uploads falham com 403).
|
||||
await storage.loadConfigFromDb();
|
||||
|
||||
return res.json({ success: true, message: 'Configurações salvas com sucesso.' });
|
||||
} catch (error) {
|
||||
console.error('Erro ao salvar storage-config:', error);
|
||||
|
||||
Reference in New Issue
Block a user