Set FileLoadedEvent::source in the subclass
Setting it in the super class means we don't set the right value for every case
This commit is contained in:
@@ -53,7 +53,7 @@ abstract class BasePersisterService extends Service{
|
||||
Set<Destination> sourceSet = sources.stream().map({ d -> new Destination(d.toString())}).collect Collectors.toSet()
|
||||
DownloadedFile df = new DownloadedFile(file, ih, pieceSize, sourceSet)
|
||||
df.setComment(json.comment)
|
||||
return new FileLoadedEvent(loadedFile : df, source : "PersisterService")
|
||||
return new FileLoadedEvent(loadedFile : df)
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ abstract class BasePersisterService extends Service{
|
||||
sf.hit(searcher, timestamp, query)
|
||||
}
|
||||
}
|
||||
return new FileLoadedEvent(loadedFile: sf, source : "PersisterService")
|
||||
return new FileLoadedEvent(loadedFile: sf)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ class PersisterService extends BasePersisterService {
|
||||
def event = fromJson parsed
|
||||
if (event != null) {
|
||||
log.fine("loaded file $event.loadedFile.file")
|
||||
event.source = "PersisterService"
|
||||
listener.publish event
|
||||
loaded++
|
||||
if (loaded % 10 == 0)
|
||||
|
||||
Reference in New Issue
Block a user