Suwayomi / Suwayomi-Server

A rewrite of Tachiyomi for the Desktop
Mozilla Public License 2.0
3.93k stars 201 forks source link

[Feature Request] a way to start / kill tachidesk-server from a client #264

Open skrshe opened 2 years ago

skrshe commented 2 years ago

What feature should be added to Tachidesk?

A way to initiate / terminate server on opening of first tab / closing of last tab respectively, in webui mainly

maybe expose this via button suchas: close server

Why/Project's Benefit/Existing Problem

tachidesk-server stays open until I forcefully close it (usually by sending sigkill to the process) it would be cool if I could open the webui and tachidesk server opens automatically

AriaMoradi commented 2 years ago

What's the usecase of this?

In the current infrastructure the server manages and serves webui, It's not possible to initiate the server from webui because you won't get access to webui unless a server is running.

It's possible to shut down the server through an api endpoint, but you usually run the server as a daemon/service and something outside the system manages the server, so I don't see why we need this.

skrshe commented 2 years ago

Admittedly starting the server currently makes sense.

But still after closing all tabs / electron windows the server keeps running even though its not in direct use. For low end systems every process is a hit to performance for what your currently doing, so it would be nice to have a setting that if there are currently no open clients the server exits.

Would still be cool to call the system to start server when webpage is opened from a bookmark. Honestly don't know how this would work though.

AriaMoradi commented 2 years ago

Tachidesk-Server is meant to work as a daemon/service and do background jobs from time to time(we haven't coded it tho)

In the case of Server+WebUI there is no way to start the server, but we could have an api to tell the server to shutdown? or put it into a monitor mode? all and all I don't think it's a good idea because you 'the user' is meant to manage the server not one of it's clients

Tachidesk-JUI comes with an embedded server and manages the server by it's own, you could try using that.

skrshe commented 2 years ago

haven't tried JUI recently, so will do

the webui is comming along very well overall just having the option to enable server quit on all clients closed would be a godsend

pc-v2 commented 1 year ago

I really like this idea, I run Tachidesk only when I want to as an app. I only have 1 PC, and not planning to have a dedicated server,