Merge pull request #164 from jmorganca/restart-server
restart server more gracefully
This commit is contained in:
commit
c448443813
|
@ -11,7 +11,9 @@
|
||||||
"make": "electron-forge make",
|
"make": "electron-forge make",
|
||||||
"make:sign": "SIGN=1 electron-forge make",
|
"make:sign": "SIGN=1 electron-forge make",
|
||||||
"publish": "SIGN=1 electron-forge publish",
|
"publish": "SIGN=1 electron-forge publish",
|
||||||
"lint": "eslint --ext .ts,.tsx ."
|
"lint": "eslint --ext .ts,.tsx .",
|
||||||
|
"format": "prettier --check . --ignore-path .gitignore",
|
||||||
|
"format:fix": "prettier --write . --ignore-path .gitignore"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": {
|
"author": {
|
||||||
|
|
4
app/src/declarations.d.ts
vendored
4
app/src/declarations.d.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
declare module '*.svg' {
|
declare module '*.svg' {
|
||||||
const content: string;
|
const content: string
|
||||||
export default content;
|
export default content
|
||||||
}
|
}
|
|
@ -72,13 +72,13 @@ function createSystemtray() {
|
||||||
|
|
||||||
if (app.isPackaged) {
|
if (app.isPackaged) {
|
||||||
iconPath = nativeTheme.shouldUseDarkColors
|
iconPath = nativeTheme.shouldUseDarkColors
|
||||||
? path.join(process.resourcesPath, 'ollama_icon_16x16Template.png')
|
? path.join(process.resourcesPath, 'ollama_icon_16x16Template.png')
|
||||||
: path.join(process.resourcesPath, 'ollama_outline_icon_16x16Template.png')
|
: path.join(process.resourcesPath, 'ollama_outline_icon_16x16Template.png')
|
||||||
}
|
}
|
||||||
|
|
||||||
tray = new Tray(iconPath)
|
tray = new Tray(iconPath)
|
||||||
|
|
||||||
nativeTheme.on('updated', function theThemeHasChanged () {
|
nativeTheme.on('updated', function theThemeHasChanged() {
|
||||||
if (nativeTheme.shouldUseDarkColors) {
|
if (nativeTheme.shouldUseDarkColors) {
|
||||||
app.isPackaged
|
app.isPackaged
|
||||||
? tray.setImage(path.join(process.resourcesPath, 'ollama_icon_16x16Template.png'))
|
? tray.setImage(path.join(process.resourcesPath, 'ollama_icon_16x16Template.png'))
|
||||||
|
@ -116,8 +116,7 @@ function server() {
|
||||||
})
|
})
|
||||||
|
|
||||||
function restart() {
|
function restart() {
|
||||||
logger.info('Restarting the server...')
|
setTimeout(server, 3000)
|
||||||
server()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proc.on('exit', restart)
|
proc.on('exit', restart)
|
||||||
|
|
Loading…
Reference in a new issue