mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Make desktop.Start run on main thread (#2475)
This commit is contained in:
@@ -255,7 +255,6 @@ func (s *singleton) PostInit(ctx context.Context) error {
|
||||
|
||||
s.ScraperCache = instance.initScraperCache()
|
||||
writeStashIcon()
|
||||
go desktop.Start(instance, &FaviconProvider{uiBox: ui.UIBox})
|
||||
|
||||
// clear the downloads and tmp directories
|
||||
// #1021 - only clear these directories if the generated folder is non-empty
|
||||
@@ -289,7 +288,7 @@ func (s *singleton) PostInit(ctx context.Context) error {
|
||||
|
||||
func writeStashIcon() {
|
||||
p := FaviconProvider{
|
||||
uiBox: ui.UIBox,
|
||||
UIBox: ui.UIBox,
|
||||
}
|
||||
|
||||
iconPath := filepath.Join(instance.Config.GetConfigPath(), "icon.png")
|
||||
@@ -484,6 +483,9 @@ func (s *singleton) GetSystemStatus() *models.SystemStatus {
|
||||
|
||||
// Shutdown gracefully stops the manager
|
||||
func (s *singleton) Shutdown(code int) {
|
||||
// stop any profiling at exit
|
||||
pprof.StopCPUProfile()
|
||||
|
||||
// TODO: Each part of the manager needs to gracefully stop at some point
|
||||
// for now, we just close the database.
|
||||
err := database.Close()
|
||||
@@ -493,5 +495,6 @@ func (s *singleton) Shutdown(code int) {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user