Commit 832b4db9 authored by Jeffrey Morgan's avatar Jeffrey Morgan
Browse files

Use correct url for auto updates

parent c43873f3
...@@ -162,11 +162,14 @@ app.on('before-quit', () => { ...@@ -162,11 +162,14 @@ app.on('before-quit', () => {
} }
}) })
let currentReleaseURL = '' const updateURL = `https://ollama.ai/api/update?os=${process.platform}&arch=${
process.arch
}&version=${app.getVersion()}&id=${id()}`
let latest = ''
async function isNewReleaseAvailable() { async function isNewReleaseAvailable() {
try { try {
const response = await fetch('https://ollama.ai/api/update') const response = await fetch(updateURL)
if (!response.ok) { if (!response.ok) {
return false return false
...@@ -183,11 +186,12 @@ async function isNewReleaseAvailable() { ...@@ -183,11 +186,12 @@ async function isNewReleaseAvailable() {
return false return false
} }
if (url === currentReleaseURL) { if (latest === url) {
return false return false
} }
currentReleaseURL = url latest = url
return true return true
} catch (error) { } catch (error) {
logger.error(`update check failed - ${error}`) logger.error(`update check failed - ${error}`)
...@@ -285,11 +289,7 @@ function id(): string { ...@@ -285,11 +289,7 @@ function id(): string {
return uuid return uuid
} }
autoUpdater.setFeedURL({ autoUpdater.setFeedURL({ url: updateURL })
url: `https://ollama.ai/api/update?os=${process.platform}&arch=${
process.arch
}&version=${app.getVersion()}&id=${id()}`,
})
autoUpdater.on('error', e => { autoUpdater.on('error', e => {
logger.error(`update check failed - ${e.message}`) logger.error(`update check failed - ${e.message}`)
......
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