Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default refresh interval to 60 seconds #144389

Merged
merged 7 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/plugins/data/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ export function getUiSettings(
defaultMessage: 'Time filter refresh interval',
}),
value: `{
"pause": false,
"value": 0
"pause": true,
"value": 60000
}`,
type: 'json',
description: i18n.translate('data.advancedSettings.timepicker.refreshIntervalDefaultsText', {
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/discover/group1/_shared_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const expectedUrl =
baseUrl +
'/app/discover?_t=1453775307251#' +
'/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time' +
'/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time' +
":(from:'2015-09-19T06:31:44.000Z',to:'2015-09" +
"-23T18:31:44.000Z'))&_a=(columns:!(),filters:!(),index:'logstash-" +
"*',interval:auto,query:(language:kuery,query:'')" +
Expand All @@ -102,7 +102,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
baseUrl +
'/app/discover#' +
'/view/ab12e3c0-f231-11e6-9486-733b1ac9221a' +
'?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)' +
'?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A60000)' +
"%2Ctime%3A(from%3A'2015-09-19T06%3A31%3A44.000Z'%2C" +
"to%3A'2015-09-23T18%3A31%3A44.000Z'))";
await PageObjects.discover.loadSavedSearch('A Saved Search');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export const useRefreshInterval = (

function initAutoRefresh() {
const interval = globalState?.refreshInterval ?? timefilter.getRefreshInterval();
const { value } = interval;
const { pause, value } = interval;

if (value === 0) {
if (pause === true || value === 0) {
// the auto refresher starts in an off state
// so switch it on and set the interval to 30s
timefilter.setRefreshInterval({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const PageWrapper: FC<PageProps> = ({ deps }) => {

useEffect(() => {
const refreshInterval =
refreshValue === 0 && refreshPause === true
refreshValue === 0 || refreshPause === true
? { pause: false, value: DEFAULT_REFRESH_INTERVAL_MS }
: { pause: refreshPause, value: refreshValue };
timefilter.setRefreshInterval(refreshInterval);
Expand Down