-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event queue not fully cleaned up on close #774
Comments
@walmor-rematter I'll have our team look into this for you |
Also @walmor-rematter sorry for all the name and label changes. We just started trying out the github/linear sync and I wasn't expecting those |
Hey @walmor-rematter! I believe the reason we don't fully cleanup the event queue on close is because there are cases where new events can be added to the queue after the That being said, we've discussed in the past that we would like to be able initializing the sdk multiple times for use cases like your own. I'll bring it back to the team to discuss and we will keep you posted on how we decide to handle it! In the meantime, if manually cleaning up the event queue is working for you then I would suggest going forward with that. Thanks very much for your feedback and let me know if you have any other questions! |
Hey @elliotCamblor, Got it, well, if fully cleaning up the queue on close is not possible then, yes, allowing us to initialize the SDK multiple times would be very helpful. I'll keep my workaround for now until we have a better solution. Thank you for the quick reply! |
I'm integrating our backend with
@devcycle/nodejs-server-sdk
and having a very particular issue related to hot reloading and needing to initialize the lib multiple times by callinginitializeDevCycle
.We have a custom hot reload mechanism that does not shut down the process. To summarize, it simply rebuilds, clears caches, and restarts the express app on the fly. Thus, imported packages (node_modules) are not reloaded after changing a file, making it very fast. However, when the app restarts and calls the
initializeDevCycle
for the second time, we get this error:We're calling
devCycleClient.close()
when the app shuts down but that doesn't solve the problem. Looking at the code, I can see that theclose()
method on theDevCycleClient
calls thecleanup
method on theEventQueue
but that's not enough. I believe that a potential solution is to also call thecleanupEventQueue(sdkKey)
method when closing the client, but I'm not sure if that has any drawbacks.That's what I'm doing to workaround the problem for now, essentially this:
It works, but I believe the
cleanupEventQueue
method was only intended to be used internally.Another solution I can see is to add an option to the
initializeDevCycle
method that would allow us to continue normally even if the queue was already created, or something like that.The text was updated successfully, but these errors were encountered: