question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Programmatically running deploy rules hangs thread

See original GitHub issue

Trying 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:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
austin43commented, Jun 26, 2017

@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.

0reactions
Memeriajcommented, Jan 9, 2019

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found