Skip to content
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

fix: smooth functions crash #264

Merged
merged 2 commits into from
Mar 31, 2021
Merged

fix: smooth functions crash #264

merged 2 commits into from
Mar 31, 2021

Conversation

grant
Copy link
Contributor

@grant grant commented Mar 31, 2021

Simplifies CTRL + C exit by immediately exiting process. Should make the local development exiting process better. Removes the "Received ^C" message. Tested locally.

Fixes: #260

More context is here too: #126 (comment)

I believe the Node server was kept alive in some cases, even after a SIGINT, which makes the local dev process frustrating.

Example FF cancel

npm start

> ffnodelocalerr@1.0.0 start /Users/timmerman/Documents/trash/ffnodelocalerr
> functions-framework --target=helloWorld

Serving function...
Function: helloWorld
Signature type: http
URL: http://localhost:8080/
^C%      

Example test

{
  "name": "ffnodelocalerr",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "functions-framework --target=helloWorld",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@google-cloud/functions-framework": "file:/Users/timmerman/Documents/github/googlecloudplatform/functions-framework-nodejs"
  }
}
/**
 * Send "Hello, World!"
 * @param req https://expressjs.com/en/api.html#req
 * @param res https://expressjs.com/en/api.html#res
 */
 exports.helloWorld = (req, res) => {
  res.send('Hello, World!');
};

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
@grant grant requested a review from mtraver March 31, 2021 01:37
@grant grant self-assigned this Mar 31, 2021
@google-cla google-cla bot added the cla: yes label Mar 31, 2021
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
@grant grant merged commit 506c503 into master Mar 31, 2021
@grant grant deleted the grant_smooth_ctrl_c branch March 31, 2021 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with ending of process when developing locally
2 participants