mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Fix Graphql-WS errors and Improve Downloader Subscription (#634)
* Fix errors in graphql-ws * Send download messages more often
This commit is contained in:
@@ -112,7 +112,7 @@ class ApolloSubscriptionProtocolHandler(
|
|||||||
return subscriptionHandler.executeSubscription(request, graphQLContext)
|
return subscriptionHandler.executeSubscription(request, graphQLContext)
|
||||||
.map {
|
.map {
|
||||||
if (it.errors?.isNotEmpty() == true) {
|
if (it.errors?.isNotEmpty() == true) {
|
||||||
SubscriptionOperationMessage(type = GQL_ERROR.type, id = operationMessage.id, payload = it)
|
SubscriptionOperationMessage(type = GQL_ERROR.type, id = operationMessage.id, payload = it.errors)
|
||||||
} else {
|
} else {
|
||||||
SubscriptionOperationMessage(type = GQL_NEXT.type, id = operationMessage.id, payload = it)
|
SubscriptionOperationMessage(type = GQL_NEXT.type, id = operationMessage.id, payload = it)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,12 +132,11 @@ object DownloadManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun notifyAllClients(immediate: Boolean = false) {
|
private fun notifyAllClients(immediate: Boolean = false) {
|
||||||
|
scope.launch {
|
||||||
|
notifyFlow.emit(Unit)
|
||||||
|
}
|
||||||
if (immediate) {
|
if (immediate) {
|
||||||
sendStatusToAllClients()
|
sendStatusToAllClients()
|
||||||
} else {
|
|
||||||
scope.launch {
|
|
||||||
notifyFlow.emit(Unit)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*if (downloadChapter != null) { TODO GRAPHQL
|
/*if (downloadChapter != null) { TODO GRAPHQL
|
||||||
downloadSubscriptionSource.publish(downloadChapter)
|
downloadSubscriptionSource.publish(downloadChapter)
|
||||||
|
|||||||
Reference in New Issue
Block a user