fix showing Failed status if there are no collections

pull/53/head
Zlatin Balevsky 2020-11-11 08:51:22 +00:00
parent 4a03ce5fff
commit a28a7e66a1
No known key found for this signature in database
GPG Key ID: A72832072D525E41
2 changed files with 7 additions and 0 deletions

View File

@ -55,6 +55,10 @@ class CollectionsClient {
InputStream is = endpoint.getInputStream()
String code = DataUtil.readTillRN(is)
if (code.startsWith("404")) {
eventBus.publish(new CollectionFetchStatusEvent(status : CollectionFetchStatus.FINISHED, uuid : e.uuid))
return
}
if (!code.startsWith("200"))
throw new Exception("invalid code $code")

View File

@ -681,6 +681,9 @@ class ConnectionAcceptor {
dos?.flush()
dos?.close()
} catch (Exception ignore) {}
try {
e.getOutputStream().close()
} catch(Exception ignore) {}
e.close()
}
}