mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
fix(book-requests): tell a plugin indexer when its connection changes
Add an optional forget(indexerId) to the plugin contract and forward the host's existing invalidation to it, so a plugin holding a live session drops it when the credential, base URL or private-address setting changes. A plugin that throws or rejects in forget is logged and never fails the save. Fixes #1325
This commit is contained in:
@@ -252,4 +252,11 @@ export interface IndexerPlugin {
|
||||
resolveFile?(release: PluginReleaseCandidate, config: PluginIndexerConfig, host: PluginHost, signal: AbortSignal): Promise<PluginReleaseFile>;
|
||||
/** Sources whose session expires on its own clock, called on a schedule while enabled. */
|
||||
keepalive?(config: PluginIndexerConfig, host: PluginHost): Promise<void>;
|
||||
/**
|
||||
* Drop anything held in memory for this indexer, such as a live session. Called when an operator
|
||||
* changes its base URL, credential or private-address setting, so the next call starts from the
|
||||
* stored config. Not awaited, and a failure is logged rather than reported. Never called by hosts
|
||||
* older than the hook.
|
||||
*/
|
||||
forget?(indexerId: number): void | Promise<void>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user