[storage-aws] don't create new event listener for every event
This commit is contained in:
parent
c646ae82fa
commit
e0beef9d73
1 changed files with 4 additions and 3 deletions
|
@ -74,9 +74,10 @@ trait Uploader {
|
|||
: UploadEventListener.Settings => ProgressListener =
|
||||
listenerSettings =>
|
||||
new ProgressListener {
|
||||
override def progressChanged(progressEvent: ProgressEvent): Unit =
|
||||
UploadEventListener.listener(listenerSettings)(
|
||||
eventHandler(progressEvent))
|
||||
private val listener = UploadEventListener.listener(listenerSettings)
|
||||
override def progressChanged(progressEvent: ProgressEvent): Unit = {
|
||||
listener(eventHandler(progressEvent))
|
||||
}
|
||||
|
||||
private def eventHandler: ProgressEvent => UploadEvent =
|
||||
progressEvent => {
|
||||
|
|
Loading…
Reference in a new issue