Merge pull request #5874 from APriestman/6333_changeTimelineEventHandling

6333 Don't load data sources for TIMELINE_EVENT_ADDED
This commit is contained in:
Richard Cordovano 2020-05-06 17:40:56 -04:00 committed by GitHub
commit d95cd23546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -657,6 +657,17 @@ public final class EventsModel {
} }
return postTagsDeleted(updatedEventIDs); return postTagsDeleted(updatedEventIDs);
} }
/**
* Updates the events model for a data source added event.
*
* @throws TskCoreException If there is an error reading model data from the
* case database.
*/
synchronized void handleDataSourceAdded() throws TskCoreException {
populateDataSourcesCache();
invalidateCaches(null);
}
/** /**
* Updates the events model for an artifact tag deleted event and publishes * Updates the events model for an artifact tag deleted event and publishes
@ -782,7 +793,6 @@ public final class EventsModel {
* @throws TskCoreException * @throws TskCoreException
*/ */
public synchronized void invalidateCaches(Collection<Long> updatedEventIDs) throws TskCoreException { public synchronized void invalidateCaches(Collection<Long> updatedEventIDs) throws TskCoreException {
populateDataSourcesCache();
minEventTimeCache.invalidateAll(); minEventTimeCache.invalidateAll();
maxEventTimeCache.invalidateAll(); maxEventTimeCache.invalidateAll();
idsToEventsCache.invalidateAll(emptyIfNull(updatedEventIDs)); idsToEventsCache.invalidateAll(emptyIfNull(updatedEventIDs));

View File

@ -783,7 +783,7 @@ public class TimeLineController {
break; break;
case DATA_SOURCE_ADDED: case DATA_SOURCE_ADDED:
future = executor.submit(() -> { future = executor.submit(() -> {
filteredEvents.invalidateCaches(null); filteredEvents.handleDataSourceAdded();
return null; return null;
}); });
break; break;