[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 =
|
: UploadEventListener.Settings => ProgressListener =
|
||||||
listenerSettings =>
|
listenerSettings =>
|
||||||
new ProgressListener {
|
new ProgressListener {
|
||||||
override def progressChanged(progressEvent: ProgressEvent): Unit =
|
private val listener = UploadEventListener.listener(listenerSettings)
|
||||||
UploadEventListener.listener(listenerSettings)(
|
override def progressChanged(progressEvent: ProgressEvent): Unit = {
|
||||||
eventHandler(progressEvent))
|
listener(eventHandler(progressEvent))
|
||||||
|
}
|
||||||
|
|
||||||
private def eventHandler: ProgressEvent => UploadEvent =
|
private def eventHandler: ProgressEvent => UploadEvent =
|
||||||
progressEvent => {
|
progressEvent => {
|
||||||
|
|
Loading…
Reference in a new issue