Skip to content

Commit

Permalink
Merge pull request #26 from fnproject/fix-idle-bug
Browse files Browse the repository at this point in the history
fix idle timeout issue
  • Loading branch information
denismakogon authored Apr 16, 2019
2 parents a028b75 + 05e4001 commit 6e79ea6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions fn-fdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,15 @@ function handleHTTPStream (fnfunction, options) {
}

let currentServer = http.createServer(functionHandler)
.listen(tmpFile, () => {
fs.chmodSync(tmpFile, '666')
fs.symlinkSync(tmpFileBaseName, listenFile)
})
.on('error', (error) => {
console.warn(`Unable to connect to unix socket ${tmpFile}`, error)
process.exit(3)
})
currentServer.keepAliveTimeout = 0 // turn off
currentServer.listen(tmpFile, () => {
fs.chmodSync(tmpFile, '666')
fs.symlinkSync(tmpFileBaseName, listenFile)
})
currentServer.on('error', (error) => {
console.warn(`Unable to connect to unix socket ${tmpFile}`, error)
process.exit(3)
})

return () => {
currentServer.close()
Expand Down

0 comments on commit 6e79ea6

Please sign in to comment.