"src/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "8aac1f99d7af5873db7d23c07fba370d0f5061a6"
Unverified Commit c43873f3 authored by Bruce MacDonald's avatar Bruce MacDonald Committed by GitHub
Browse files

check update response (#785)

parent d790bf99
...@@ -168,17 +168,26 @@ async function isNewReleaseAvailable() { ...@@ -168,17 +168,26 @@ async function isNewReleaseAvailable() {
try { try {
const response = await fetch('https://ollama.ai/api/update') const response = await fetch('https://ollama.ai/api/update')
if (!response.ok) {
return false
}
if (response.status === 204) { if (response.status === 204) {
return false return false
} }
const data = await response.json() const data = await response.json()
if (currentReleaseURL === data.url) { const url = data?.url
if (!url) {
return false
}
if (url === currentReleaseURL) {
return false return false
} }
currentReleaseURL = data.url currentReleaseURL = url
return true return true
} catch (error) { } catch (error) {
logger.error(`update check failed - ${error}`) logger.error(`update check failed - ${error}`)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment