mirror of
https://github.com/skooner-k8s/skooner.git
synced 2026-08-24 04:16:18 +00:00
Merging
This commit is contained in:
@@ -121,13 +121,23 @@ function oidcFactory() {
|
||||
}
|
||||
|
||||
function metrics(url: string, cb: DataCallback<Metrics[]>) {
|
||||
let isApiRequestInProgress = false;
|
||||
const handel = setInterval(getMetrics, 10000);
|
||||
getMetrics();
|
||||
|
||||
async function getMetrics() {
|
||||
try {
|
||||
const metric = await request(url);
|
||||
cb(metric.items || metric);
|
||||
if (!isApiRequestInProgress) {
|
||||
isApiRequestInProgress = true;
|
||||
try {
|
||||
const metric = await request(url);
|
||||
cb(metric.items || metric);
|
||||
} catch (err) {
|
||||
log.error('Unable to send request', {err});
|
||||
} finally {
|
||||
isApiRequestInProgress = false;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
log.error('No metrics', {err, url});
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ function ControllerStatusChart({items}: {items: ApiItem<any, any>[] | null}) {
|
||||
|
||||
return (
|
||||
<div className='charts_item'>
|
||||
{items && count && pending ? (
|
||||
{items && count != null && pending != null ? (
|
||||
<Chart used={count - pending} pending={pending} available={count} />
|
||||
) : (
|
||||
<LoadingChart />
|
||||
|
||||
Reference in New Issue
Block a user