File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
app/src/main/java/to/bitkit/services Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -262,12 +262,11 @@ class ActivityService(
262262 payments.chunked(CHUNCK_SIZE ).forEach { chunk ->
263263 val results = chunk.map { payment ->
264264 async {
265- try {
265+ runCatching {
266266 processSinglePayment(payment, forceUpdate)
267- Result .success( payment.id)
268- } catch (e : Throwable ) {
267+ payment.id
268+ }.onFailure { e ->
269269 Logger .error(" Error syncing payment ${payment.id} :" , e, context = " CoreService" )
270- Result .failure<String >(e)
271270 }
272271 }
273272 }.awaitAll()
@@ -281,11 +280,6 @@ class ActivityService(
281280 " Synced ${successful.size} payments successfully, ${failed.size} failed" ,
282281 context = " CoreService"
283282 )
284-
285- // Throw if too many failed
286- if (failed.size > payments.size * 0.5 ) {
287- throw Exception (" Too many payment sync failures: ${failed.size} /${payments.size} " )
288- }
289283 }
290284 }
291285 }
You can’t perform that action at this time.
0 commit comments