File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/com/conveyal/datatools/common/utils Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 26
26
import java .util .concurrent .TimeUnit ;
27
27
28
28
import static com .conveyal .datatools .common .utils .Utils .getTimezone ;
29
+ import static com .google .common .collect .Multimaps .synchronizedListMultimap ;
29
30
30
31
/**
31
32
* This class centralizes the logic associated with scheduling and cancelling tasks (organized as a {@link ScheduledJob})
@@ -41,9 +42,11 @@ public class Scheduler {
41
42
// Scheduled executor that handles running scheduled jobs.
42
43
public final static ScheduledExecutorService schedulerService = Executors .newScheduledThreadPool (1 );
43
44
/** Stores {@link ScheduledJob} objects containing scheduled tasks keyed on the tasks's associated {@link FeedSource} ID. */
44
- public final static ListMultimap <String , ScheduledJob > scheduledJobsForFeedSources = ArrayListMultimap .create ();
45
+ public final static ListMultimap <String , ScheduledJob > scheduledJobsForFeedSources =
46
+ synchronizedListMultimap (ArrayListMultimap .create ());
45
47
/** Stores {@link ScheduledJob} objects containing scheduled tasks keyed on the tasks's associated {@link Project} ID. */
46
- public final static ListMultimap <String , ScheduledJob > scheduledJobsForProjects = ArrayListMultimap .create ();
48
+ public final static ListMultimap <String , ScheduledJob > scheduledJobsForProjects =
49
+ synchronizedListMultimap (ArrayListMultimap .create ());
47
50
48
51
/**
49
52
* A method to initialize all scheduled tasks upon server startup.
You can’t perform that action at this time.
0 commit comments