fix: extension stop background work (#2281)

* feat: add helper methods

* fix: do not try to stop background work on first install

* fix: first stop via function call then try REST API

* fix: `make check`

* fix: prepare for `{ext_id}_stop`
This commit is contained in:
Vlad Stan
2024-02-21 12:08:37 +02:00
committed by GitHub
parent fe12eccc42
commit c51e7351e8
3 changed files with 55 additions and 3 deletions
+3 -2
View File
@@ -824,8 +824,9 @@ async def api_install_extension(
await add_installed_extension(ext_info)
# call stop while the old routes are still active
await stop_extension_background_work(data.ext_id, user.id, access_token)
if extension.is_upgrade_extension:
# call stop while the old routes are still active
await stop_extension_background_work(data.ext_id, user.id, access_token)
if data.ext_id not in settings.lnbits_deactivated_extensions:
settings.lnbits_deactivated_extensions += [data.ext_id]