<commit_before>import { delay } from 'redux-saga';
import { ScheduleNextSearch } from '../actions/scheduler';

export function* searchAfterDelay(action: ScheduleNextSearch) {
  console.log(Math.abs(action.time.valueOf() - Date.now()));
  yield delay(action.time.valueOf() - Date.now());
  console.log('this was a delayed action');
  try {
  } catch (e) {}
}
<commit_msg>Clicking the 'Start searching' will continually send search requests.<commit_after>import { delay } from 'redux-saga';
import { put } from 'redux-saga/effects';
import { SearchRequest, searchRequest } from '../actions/search';
import { ScheduleNextSearch } from '../actions/scheduler';

export function* searchAfterDelay(action: ScheduleNextSearch) {
  try {
    yield delay(action.time.valueOf() - Date.now());
    yield put<SearchRequest>(searchRequest());
  } catch (e) {}
}
{'fraction_non_alphanumeric': 0.15348288075560804, 'fraction_numerical': 0.0, 'mean_word_length': 4.93006993006993, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3683740', 'n_tokens_mistral': 248, 'n_tokens_neox': 247, 'n_words': 62}