Callbacks before termination for custom Components

Hey. First of all, thanks for developing and maintaining a wonderful framework.

I am using custom components as part of my NLU Pipeline. I am in need of callbacks for my components, particularly before termination of the process.

Some of my components need to clean up before termination, and also for uploading their custom logs to cloud.

Some temporary solutions that i tried:

  1. Use APScheduler to frequently check for updates and any syncups I need to do.
  2. I tried listening for Sigterm signal from python Stackoverflow Link. But that also doesn’t seem to work.

Is there a more clean way provided from rasa which I can use to accomplish this?

Hi Srinath and welcome to the forum.

Have you tried the atexit module?