Skip to content

Commit c088f9c

Browse files
committed
Rebuild caches after clearing cache
and before incrementing in-memory structures.
1 parent 1628fff commit c088f9c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/galaxy/jobs/handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,9 @@ def __handle_waiting_jobs(self):
518518
pass
519519
# Ensure that we get new job counts on each iteration
520520
self.__clear_job_count()
521+
self.__cache_total_job_count_per_destination()
522+
self.__cache_user_job_count_per_destination()
523+
self.__cache_user_job_count()
521524
# Check resubmit jobs first so that limits of new jobs will still be enforced
522525
for job in resubmit_jobs:
523526
log.debug("(%s) Job was resubmitted and is being dispatched immediately", job.id)
@@ -824,7 +827,6 @@ def __clear_job_count(self):
824827
self.total_job_count_per_destination = None
825828

826829
def get_user_job_count(self, user_id):
827-
self.__cache_user_job_count()
828830
# This could have been incremented by a previous job dispatched on this iteration, even if we're not caching
829831
rval = self.user_job_count.get(user_id, 0)
830832
if not self.app.config.cache_user_job_count:
@@ -865,7 +867,6 @@ def __cache_user_job_count(self):
865867
self.user_job_count = {}
866868

867869
def get_user_job_count_per_destination(self, user_id):
868-
self.__cache_user_job_count_per_destination()
869870
cached = self.user_job_count_per_destination.get(user_id, {})
870871
if self.app.config.cache_user_job_count:
871872
rval = cached
@@ -1006,7 +1007,6 @@ def __cache_total_job_count_per_destination(self):
10061007
self.total_job_count_per_destination[row["destination_id"]] = row["job_count"]
10071008

10081009
def get_total_job_count_per_destination(self):
1009-
self.__cache_total_job_count_per_destination()
10101010
# Always use caching (at worst a job will have to wait one iteration,
10111011
# and this would be more fair anyway as it ensures FIFO scheduling,
10121012
# insofar as FIFO would be fair...)

0 commit comments

Comments
 (0)