Ensure only once event source is running
Thanks ipoupaile
This commit is contained in:
parent
f6edb178dd
commit
558d34c6cf
|
@ -95,12 +95,12 @@ class Api(context: Context) {
|
||||||
.get()
|
.get()
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
syncSource.set(
|
syncSource.getAndSet(
|
||||||
EventSources.createFactory(client).newEventSource(
|
EventSources.createFactory(client).newEventSource(
|
||||||
request,
|
request,
|
||||||
SSEListener(context)
|
SSEListener(context)
|
||||||
)
|
)
|
||||||
)
|
)?.cancel()
|
||||||
Log.d(TAG, "cSync done.")
|
Log.d(TAG, "cSync done.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue