On Server Shutdown

Posted on
Sat Dec 02, 2023 12:14 am
Korey offline
User avatar
Posts: 813
Joined: Jun 04, 2008
Location: Henderson, NV

On Server Shutdown

Any way to have a trigger fire on :

Code: Select all
  Quitting Indigo Server - received slow quit signal
   Quitting Indigo Server - stopping plugins


Edit - Well, I guess I actually don't need it now, the new M1 server is fast enough that my looking scripts for Music and Spotify quit and the machine restarts as it should,,

--
Korey

Posted on
Tue Jan 09, 2024 3:34 pm
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: On Server Shutdown

Hey Korey - I know you said that you didn't need this any longer, but I wanted to follow up for future forum searchers. I think it might be possible to do this within a plugin depending on what you want to do. Plugins can include an optional shutdown() method which will be called when the server is shutting down:

Code: Select all
2024-01-09 15:15:57.842   Application   Quitting Indigo Server - received slow quit signal
2024-01-09 15:15:57.848   Application   Quitting Indigo Server - stopping plugins
...
2024-01-09 15:15:59.648   Multitool Warning   The server is shutting down.    <------- this is from the shutdown method in the plugin.
2024-01-09 15:16:00.668   Application   Stopped plugin "Multitool 2023.1.0"
What might be an issue is the fact that server tasks are handled asynchronously and -- if the shutdown() method sends commands to the server -- you can't guarantee that they'll be done in order without some kind of blocking/feedback mechanism. That said, I would think the method could call an Indigo Trigger without any issues. (Someone please correct me if I'm wrong about this.)

By the way, an official shutdown trigger is on the list for the future.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 9 guests