Skip to content

Commit

Permalink
perf: reduce warnings caused by network connection failures (tiny-cra…
Browse files Browse the repository at this point in the history
  • Loading branch information
tiny-craft committed May 17, 2024
1 parent abf5534 commit 4dd52a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions frontend/src/components/content_value/ContentServerStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ const refreshInfo = async (force) => {
}
if (!isEmpty(props.server) && browserStore.isConnected(props.server)) {
try {
const info = await browserStore.getServerInfo(props.server)
serverInfo.value = info
_updateChart(info)
const info = await browserStore.getServerInfo(props.server, true)
if (!isEmpty(info)) {
serverInfo.value = info
_updateChart(info)
}
} finally {
pageState.loading = false
pageState.autoLoading = false
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/stores/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,11 @@ const useBrowserStore = defineStore('browser', {

/**
*
* @param server
* @param {string} server
* @param {boolean} mute
* @returns {Promise<{}>}
*/
async getServerInfo(server) {
async getServerInfo(server, mute) {
try {
const { success, data, msg } = await ServerInfo(server)
if (success) {
Expand All @@ -356,7 +357,7 @@ const useBrowserStore = defineStore('browser', {
serverInst.stats = data
}
return data
} else if (!isEmpty(msg)) {
} else if (!isEmpty(msg) && mute !== true) {
$message.warning(msg)
}
} finally {
Expand Down

0 comments on commit 4dd52a8

Please sign in to comment.