Programmatically running deploy rules hangs thread
See original GitHub issueTrying to do something similar to the example in the firebase-tools docs.
var client = require('firebase-tools');
client.deploy.rules({
firebase: 'myfirebase',
token: process.env.FIREBASE_TOKEN,
cwd: '/path/to/project/folder'
}).then(function() {
console.log('Rules have been deployed!')
}).catch(function(err) {
// handle error
});
The rules successfully deploy but the thread seems to hang after running this command. I have ensured that my firebase token is set properly.
Do the tools need to be shutdown in any particular way when being used programmatically?
I’m currently running firebase-tools 2.2.0 and node v5.2.0
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Processes and threads overview - Android Developers
From the user's perspective, the application appears to hang. Even worse, if the UI thread is blocked for more than a few seconds...
Read more >How to prevent Spring Boot daemon/server application from ...
I found the solution, using org.springframework.boot.CommandLineRunner + Thread.currentThread().join() , e.g.: (note: code below is in Groovy, not Java)
Read more >Top 10 most common Java performance problems
Stop-the-world garbage collection refers to a major garbage collection that freezes all running threads in the JVM in order to reclaim memory. It's...
Read more >Deployment - Uvicorn
As a general rule, you probably want to: Run uvicorn --reload from the command line for local development. Run gunicorn -k uvicorn.workers.
Read more >Running MockServer
MockServer can be run: programmatically via a Java API in an @Before or @After method; using a JUnit 4 @Rule via a @Rule...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mbleigh Are there other recommendations on this? process.exit() isn’t a viable method because if you’re running the script inside of another process it will quit the whole thing.
So we’ve removed almost all of our usages of long running websockets in the CLI (in favor of more direct REST requests). So recent versions of the CLI exit normally on its own when using it progammatically. If this is not the case please open another issue for the specific command (I believe that all of the deploys should be fine, but I suppose there could be some other lingering usages that I was unaware of).