remove refreshing by keys from refresh service

Signed-off-by: Kiss Miklos <miklos@roadie.io>
This commit is contained in:
Kiss Miklos
2022-07-07 12:03:37 +02:00
parent f3caf2e4b2
commit 6714971845
5 changed files with 4 additions and 25 deletions
@@ -22,7 +22,6 @@ import { AuthorizedRefreshService } from './AuthorizedRefreshService';
describe('AuthorizedRefreshService', () => {
const refreshService = {
refresh: jest.fn(),
refreshByRefreshKeys: jest.fn(),
};
const permissionApi = {
authorize: jest.fn(),
@@ -20,11 +20,7 @@ import {
AuthorizeResult,
PermissionEvaluator,
} from '@backstage/plugin-permission-common';
import {
RefreshByRefreshKeysOptions,
RefreshOptions,
RefreshService,
} from './types';
import { RefreshOptions, RefreshService } from './types';
export class AuthorizedRefreshService implements RefreshService {
constructor(
@@ -49,7 +45,4 @@ export class AuthorizedRefreshService implements RefreshService {
}
await this.service.refresh(options);
}
async refreshByRefreshKeys(options: RefreshByRefreshKeysOptions) {
await this.service.refreshByRefreshKeys(options);
}
}
@@ -15,11 +15,7 @@
*/
import { DefaultProcessingDatabase } from '../database/DefaultProcessingDatabase';
import {
RefreshByRefreshKeysOptions,
RefreshOptions,
RefreshService,
} from './types';
import { RefreshOptions, RefreshService } from './types';
export class DefaultRefreshService implements RefreshService {
private database: DefaultProcessingDatabase;
@@ -49,9 +45,4 @@ export class DefaultRefreshService implements RefreshService {
});
});
}
async refreshByRefreshKeys(options: RefreshByRefreshKeysOptions) {
await this.database.transaction(async tx => {
await this.database.refreshByRefreshKeys(tx, options);
});
}
}
@@ -57,7 +57,7 @@ describe('createRouter readonly disabled', () => {
listLocations: jest.fn(),
deleteLocation: jest.fn(),
};
refreshService = { refresh: jest.fn(), refreshByRefreshKeys: jest.fn() };
refreshService = { refresh: jest.fn() };
orchestrator = { process: jest.fn() };
const router = await createRouter({
entitiesCatalog,
@@ -712,7 +712,7 @@ describe('NextRouter permissioning', () => {
listLocations: jest.fn(),
deleteLocation: jest.fn(),
};
refreshService = { refresh: jest.fn(), refreshByRefreshKeys: jest.fn() };
refreshService = { refresh: jest.fn() };
const router = await createRouter({
entitiesCatalog,
locationService,
@@ -61,9 +61,6 @@ export type RefreshOptions = {
authorizationToken?: string;
};
export type RefreshByRefreshKeysOptions = {
keys: string[];
};
/**
* A service that manages refreshes of entities in the catalog.
*
@@ -74,7 +71,6 @@ export interface RefreshService {
* Request a refresh of entities in the catalog.
*/
refresh(options: RefreshOptions): Promise<void>;
refreshByRefreshKeys(options: RefreshByRefreshKeysOptions): Promise<void>;
}
/**