Fix possibility of requests queueing up in recursive watchHistory call

You can test this manually by delaying the response in
https://github.com/galaxyproject/galaxy/blob/928bb4b4622f57c1fb8d8eecbe4cc9b260e5aab0/lib/galaxy/webapps/galaxy/controllers/history.py#L999
and hitting the refresh button a bunch of times. In the network tab
you'll see the requests piling up.
This commit is contained in:
mvdbeek
2022-06-17 15:23:51 +02:00
parent 895e028cff
commit d6cc262581
@@ -22,6 +22,8 @@ let lastUpdateTime = null;
let lastRequestDate = new Date();
export async function watchHistory() {
// "Reset" watchTimeout so we don't queue up watchHistory calls in rewatchHistory.
watchTimeout = null;
// get current history
const history = await getCurrentHistoryFromServer();
const historyId = history.id;