fix(wasabi): reload S3 client after saving credentials (403 persistia com chave antiga em memória)
continuous-integration/webhook Deploy concluído (VPS4)

This commit is contained in:
VPS 4 Deploy Agent
2026-05-30 19:03:30 +02:00
parent ed21e67686
commit b59eae1641
2 changed files with 5 additions and 1 deletions
@@ -1 +1 @@
2.1.16 2.1.17
+4
View File
@@ -185,6 +185,10 @@ router.post('/storage-config', async (req, res) => {
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, updated_at = NOW() ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, updated_at = NOW()
`, [configJson]); `, [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.' }); return res.json({ success: true, message: 'Configurações salvas com sucesso.' });
} catch (error) { } catch (error) {
console.error('Erro ao salvar storage-config:', error); console.error('Erro ao salvar storage-config:', error);