mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
fix: update system proxy fetching to use finally (#7652)
* fix: update system proxy fetching to use finally for improved reliability * Update packages/bruno-electron/src/index.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -202,11 +202,18 @@ app.on('ready', async () => {
|
||||
|
||||
// Initialize system proxy cache early (non-blocking)
|
||||
const { fetchSystemProxy } = require('./store/system-proxy');
|
||||
waitForShellEnv().then(() => {
|
||||
fetchSystemProxy().catch((err) => {
|
||||
console.warn('Failed to initialize system proxy cache:', err);
|
||||
|
||||
// Note: irrespective of the state of the shell,
|
||||
// try to fetch the system proxy information
|
||||
waitForShellEnv()
|
||||
.catch((err) => {
|
||||
console.warn('Shell env init failed:', err);
|
||||
})
|
||||
.finally(() => {
|
||||
fetchSystemProxy().catch((err) => {
|
||||
console.warn('Failed to initialize system proxy cache:', err);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Menu.setApplicationMenu(menu);
|
||||
const { maximized, x, y, width, height } = loadWindowState();
|
||||
|
||||
@@ -2,6 +2,7 @@ const { initializeShellEnv: _initializeShellEnv } = require('@usebruno/requests'
|
||||
|
||||
const TIMEOUT_MS = 60_000;
|
||||
|
||||
/** @type {null | Promise<any>} */
|
||||
let _promise = null;
|
||||
|
||||
const _initWithTimeout = () => {
|
||||
|
||||
Reference in New Issue
Block a user