Don't attempt to unregister integrations after shutting down.
Review Request #8781 — Created Feb. 25, 2017 and submitted
When a process terminates, both the extension managers and integration
managers are shut down, clearing all state. The order in which this
happens is not guaranteed, and it's very possible (and likely) for the
integration managers to shut down before the extension managers. When
this happens, any integrations registered by an extension through
BaseIntegrationHook
will fail to unregister, leaving a handful of errors
in the console or logs.We now have an enabled state on
IntegrationManager
that indicates
whether operations can be performed on the manager. This is set when
initialized, and cleared after callingshutdown()
.BaseIntegrationHook
now checks this before attempting to unregister, keeping logs clean.
Ran some management commands and stopped seeing errors during shutdown.
Unit tests pass.