Initialize the application. Called once when the dirty worker starts, after the app instance is created. Use this for expensive initialization like loading ML models, establishing database connections, etc. This method is called in the child process after f
(self)
| 96 | workers = None |
| 97 | |
| 98 | def init(self): |
| 99 | """ |
| 100 | Initialize the application. |
| 101 | |
| 102 | Called once when the dirty worker starts, after the app instance |
| 103 | is created. Use this for expensive initialization like loading |
| 104 | ML models, establishing database connections, etc. |
| 105 | |
| 106 | This method is called in the child process after fork, so it's |
| 107 | safe to initialize non-fork-safe resources here. |
| 108 | """ |
| 109 | |
| 110 | def __call__(self, action, *args, **kwargs): |
| 111 | """ |
no outgoing calls