Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
832b4db9
Commit
832b4db9
authored
Oct 13, 2023
by
Jeffrey Morgan
Browse files
Use correct url for auto updates
parent
c43873f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
app/src/index.ts
app/src/index.ts
+9
-9
No files found.
app/src/index.ts
View file @
832b4db9
...
@@ -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
(
update
URL
)
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
===
c
ur
rentReleaseURL
)
{
if
(
latest
===
ur
l
)
{
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
}
`
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment