platypush/platypush
Fabio Manganiello bf7d060b81
continuous-integration/drone/push Build is passing Details
Added `@ensure_initialized` decorator to actions in `variable`.
The `variable` plugin may break in the constructor the first time the
application is started.

That's because it tries to initialize the cache of stored variables, but
the local database hasn't yet been initialized.

That's because plugins are registered _before_ the entities engine is
initialized, as the entities engine assumes that it already has plugins
to scan for entities.

Therefore, the initialization of the `variable` plugin's cache should be
lazy (only done upon the first call to `get`/`set` etc.), in order to
prevent deadlock situations where the plugin waits for the engine to
start, but the engine will be initialized only after the plugin is
ready.

And the lazy initialization logic should also ensure that the entities
engine has been properly started (and emit a `TimeoutError` if that's
not the case), in order to prevent race conditions.
2023-08-17 02:47:30 +02:00
..
app Large refactor + stability fixes for the external process control logic. 2023-08-15 11:12:21 +02:00
backend Ignore Redis errors when a backend sends an unregister notify event. 2023-08-17 01:49:41 +02:00
bus Using a single constant for DEFAULT_REDIS_QUEUE. 2023-08-13 22:20:16 +02:00
commands Large refactor + stability fixes for the external process control logic. 2023-08-15 11:12:21 +02:00
common Better documentation for the Redis server + LINT fixes. 2023-08-02 22:17:11 +02:00
config Adapted tests to use a locally started Redis instance. 2023-07-24 10:37:07 +02:00
context Format string typo fix 2023-06-30 23:07:00 +02:00
cron Added `wait_stop` method to the entities engine and cron scheduler. 2023-08-14 23:49:47 +02:00
entities s/TimeoutError/AssertionError/ if get_entities_engine times out. 2023-08-17 02:36:40 +02:00
event Removed dependency from prctl. 2023-07-23 19:17:30 +02:00
exceptions Added support for JWT token-based authentication 2021-02-12 22:43:34 +01:00
message Removed dependency from prctl. 2023-07-23 19:17:30 +02:00
migrations Migrated `variable` table to the new entities framework. 2023-04-29 11:36:55 +02:00
platydock Upgraded Docker base image. 2023-07-23 17:25:52 +02:00
plugins Added `@ensure_initialized` decorator to actions in `variable`. 2023-08-17 02:47:30 +02:00
procedure Major LINT fixes 2021-04-05 00:58:44 +02:00
process Large refactor + stability fixes for the external process control logic. 2023-08-15 11:12:21 +02:00
runner The __main__ function should take no arguments. 2023-08-17 01:35:39 +02:00
schemas Disk I/O stats are not always available and should therefore be optional. 2023-04-23 22:25:24 +02:00
user LINT/format fixes. 2023-04-25 10:36:27 +02:00
utils Added get_remaining_timeout utility function. 2023-08-14 23:17:50 +02:00
__init__.py Added `get_default_pid_file` utility method. 2023-08-14 10:47:25 +02:00
__main__.py The __main__ function should take no arguments. 2023-08-17 01:35:39 +02:00
cli.py Added `get_default_pid_file` utility method. 2023-08-14 10:47:25 +02:00
logger.py Refactored structure of main application and startup scripts. 2023-07-23 23:12:36 +02:00