mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
chore: remove unused eslintrc (#17860)
* chore: remove unused eslintrc * remove unused lint * add comments * change comments
This commit is contained in:
@@ -16,7 +16,12 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { ensureIsArray, makeApi, SupersetClient } from '@superset-ui/core';
|
||||
import {
|
||||
ensureIsArray,
|
||||
makeApi,
|
||||
SupersetClient,
|
||||
logging,
|
||||
} from '@superset-ui/core';
|
||||
import { SupersetError } from 'src/components/ErrorMessage/types';
|
||||
import { FeatureFlag, isFeatureEnabled } from '../featureFlags';
|
||||
import {
|
||||
@@ -82,7 +87,7 @@ export const init = (appConfig?: AppConfig) => {
|
||||
config = bootstrapData?.common?.conf;
|
||||
} else {
|
||||
config = {};
|
||||
console.warn('asyncEvent: app config data not found');
|
||||
logging.warn('asyncEvent: app config data not found');
|
||||
}
|
||||
}
|
||||
transport = config.GLOBAL_ASYNC_QUERIES_TRANSPORT || TRANSPORT_POLLING;
|
||||
@@ -91,7 +96,7 @@ export const init = (appConfig?: AppConfig) => {
|
||||
try {
|
||||
lastReceivedEventId = localStorage.getItem(LOCALSTORAGE_KEY);
|
||||
} catch (err) {
|
||||
console.warn('Failed to fetch last event Id from localStorage');
|
||||
logging.warn('Failed to fetch last event Id from localStorage');
|
||||
}
|
||||
|
||||
if (transport === TRANSPORT_POLLING) {
|
||||
@@ -132,7 +137,7 @@ export const waitForAsyncData = async (asyncResponse: AsyncEvent) =>
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
console.warn('received event with status', asyncEvent.status);
|
||||
logging.warn('received event with status', asyncEvent.status);
|
||||
}
|
||||
}
|
||||
removeListener(jobId);
|
||||
@@ -171,7 +176,7 @@ const setLastId = (asyncEvent: AsyncEvent) => {
|
||||
try {
|
||||
localStorage.setItem(LOCALSTORAGE_KEY, lastReceivedEventId as string);
|
||||
} catch (err) {
|
||||
console.warn('Error saving event Id to localStorage', err);
|
||||
logging.warn('Error saving event Id to localStorage', err);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -182,7 +187,7 @@ const loadEventsFromApi = async () => {
|
||||
const { result: events } = await fetchEvents(eventArgs);
|
||||
if (events && events.length) await processEvents(events);
|
||||
} catch (err) {
|
||||
console.warn(err);
|
||||
logging.warn(err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +215,7 @@ export const processEvents = async (events: AsyncEvent[]) => {
|
||||
}, RETRY_DELAY * retriesByJobId[jobId]);
|
||||
} else {
|
||||
delete retriesByJobId[jobId];
|
||||
console.warn('listener not found for job_id', asyncEvent.job_id);
|
||||
logging.warn('listener not found for job_id', asyncEvent.job_id);
|
||||
}
|
||||
}
|
||||
setLastId(asyncEvent);
|
||||
@@ -229,7 +234,7 @@ const wsConnect = (): void => {
|
||||
ws = new WebSocket(url);
|
||||
|
||||
ws.addEventListener('open', event => {
|
||||
console.log('WebSocket connected');
|
||||
logging.log('WebSocket connected');
|
||||
clearTimeout(wsConnectTimeout);
|
||||
wsConnectRetries = 0;
|
||||
});
|
||||
@@ -240,7 +245,7 @@ const wsConnect = (): void => {
|
||||
if (wsConnectRetries <= wsConnectMaxRetries) {
|
||||
wsConnect();
|
||||
} else {
|
||||
console.warn('WebSocket not available, falling back to async polling');
|
||||
logging.warn('WebSocket not available, falling back to async polling');
|
||||
loadEventsFromApi();
|
||||
}
|
||||
}, wsConnectErrorDelay);
|
||||
@@ -257,7 +262,7 @@ const wsConnect = (): void => {
|
||||
events = [JSON.parse(event.data)];
|
||||
await processEvents(events);
|
||||
} catch (err) {
|
||||
console.warn(err);
|
||||
logging.warn(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user