fix breakages from Service interface renames

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-12-14 14:39:39 +01:00
parent a025190552
commit 05a928e296
3 changed files with 21 additions and 12 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/backend-app-api': patch
'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch
---
Updated usages of types from `@backstage/backend-plugin-api`.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
import {
BackendLifecycle,
LifecycleService,
createServiceFactory,
coreServices,
loggerToWinstonLogger,
BackendLifecycleShutdownHook,
LifecycleServiceShutdownHook,
} from '@backstage/backend-plugin-api';
import { Logger } from 'winston';
@@ -29,11 +29,11 @@ export class BackendLifecycleImpl {
}
#isCalled = false;
#shutdownTasks: Array<BackendLifecycleShutdownHook & { pluginId: string }> =
#shutdownTasks: Array<LifecycleServiceShutdownHook & { pluginId: string }> =
[];
addShutdownHook(
options: BackendLifecycleShutdownHook & { pluginId: string },
options: LifecycleServiceShutdownHook & { pluginId: string },
): void {
this.#shutdownTasks.push(options);
}
@@ -64,12 +64,12 @@ export class BackendLifecycleImpl {
}
}
class PluginScopedLifecycleImpl implements BackendLifecycle {
class PluginScopedLifecycleImpl implements LifecycleService {
constructor(
private readonly lifecycle: BackendLifecycleImpl,
private readonly pluginId: string,
) {}
addShutdownHook(options: BackendLifecycleShutdownHook): void {
addShutdownHook(options: LifecycleServiceShutdownHook): void {
this.lifecycle.addShutdownHook({ ...options, pluginId: this.pluginId });
}
}
@@ -14,9 +14,12 @@
* limitations under the License.
*/
import { Logger, loggerToWinstonLogger } from '@backstage/backend-plugin-api';
import { PluginTaskScheduler } from '@backstage/backend-tasks';
import { Config } from '@backstage/config';
import {
ConfigService,
LoggerService,
SchedulerService,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { stringifyError } from '@backstage/errors';
import {
EntityProvider,
@@ -46,10 +49,10 @@ export class WrapperProviders {
constructor(
private readonly options: {
config: Config;
logger: Logger;
config: ConfigService;
logger: LoggerService;
client: Knex;
scheduler: PluginTaskScheduler;
scheduler: SchedulerService;
applyDatabaseMigrations?: typeof applyDatabaseMigrations;
},
) {}