Skip to content

Commit

Permalink
Revert "[licensing] add license fetcher cache (#170006)" (#170185)
Browse files Browse the repository at this point in the history
This reverts commit 21c0b0b.
  • Loading branch information
jbudz authored Oct 30, 2023
1 parent 788d302 commit d7ab75f
Show file tree
Hide file tree
Showing 8 changed files with 210 additions and 386 deletions.
15 changes: 5 additions & 10 deletions x-pack/plugins/licensing/common/license_update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
takeUntil,
finalize,
startWith,
throttleTime,
} from 'rxjs/operators';
import { hasLicenseInfoChanged } from './has_license_info_changed';
import type { ILicense } from './types';
Expand All @@ -30,15 +29,11 @@ export function createLicenseUpdate(
) {
const manuallyRefresh$ = new Subject<void>();

const fetched$ = merge(
triggerRefresh$,
manuallyRefresh$.pipe(
throttleTime(1000, undefined, {
leading: true,
trailing: true,
})
)
).pipe(takeUntil(stop$), exhaustMap(fetcher), share());
const fetched$ = merge(triggerRefresh$, manuallyRefresh$).pipe(
takeUntil(stop$),
exhaustMap(fetcher),
share()
);

// provide a first, empty license, so that we can compare in the filter below
const startWithArgs = initialValues ? [undefined, initialValues] : [undefined];
Expand Down
172 changes: 0 additions & 172 deletions x-pack/plugins/licensing/server/license_fetcher.test.ts

This file was deleted.

133 changes: 0 additions & 133 deletions x-pack/plugins/licensing/server/license_fetcher.ts

This file was deleted.

12 changes: 3 additions & 9 deletions x-pack/plugins/licensing/server/licensing_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ import { PluginConfigDescriptor } from '@kbn/core/server';

const configSchema = schema.object({
api_polling_frequency: schema.duration({ defaultValue: '30s' }),
license_cache_duration: schema.duration({
defaultValue: '300s',
validate: (value) => {
if (value.asMinutes() > 15) {
return 'license cache duration must be shorter than 15 minutes';
}
},
}),
});

export type LicenseConfigType = TypeOf<typeof configSchema>;

export const config: PluginConfigDescriptor<LicenseConfigType> = {
schema: configSchema,
schema: schema.object({
api_polling_frequency: schema.duration({ defaultValue: '30s' }),
}),
};
Loading

0 comments on commit d7ab75f

Please sign in to comment.