Ensure only once event source is running

Thanks ipoupaile
This commit is contained in:
sim 2024-10-31 14:39:51 +00:00
parent f6edb178dd
commit 558d34c6cf
1 changed files with 2 additions and 2 deletions

View File

@ -95,12 +95,12 @@ class Api(context: Context) {
.get()
.build()
syncSource.set(
syncSource.getAndSet(
EventSources.createFactory(client).newEventSource(
request,
SSEListener(context)
)
)
)?.cancel()
Log.d(TAG, "cSync done.")
}
}