In cases when the requestor does not have gftp installed (you can move the file to a different location to test this), glm.disconnect() was executed quickly and the script was not closing at all. Using wtfnode showed that after glm.connect() fails due to the missing gftp, some connections to yagna were open:
This PR removes the redundant isConnected check during the disconnect method execution, allowing the code to actually close the yagna connections. This way the V8 event loop can drain from work and the program can exit normally.
This does not affect negatively the indempotency of the disconnect method at all:
The issue
In cases when the requestor does not have
gftp
installed (you can move the file to a different location to test this),glm.disconnect()
was executed quickly and the script was not closing at all. Usingwtfnode
showed that afterglm.connect()
fails due to the missinggftp
, some connections to yagna were open:The solution
This PR removes the redundant
isConnected
check during thedisconnect
method execution, allowing the code to actually close the yagna connections. This way the V8 event loop can drain from work and the program can exit normally.This does not affect negatively the indempotency of the disconnect method at all: