about summary refs log tree commit diff
path: root/streaming
diff options
context:
space:
mode:
authorGomasy <nyan@gomasy.jp>2018-10-21 23:41:33 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-10-21 16:41:33 +0200
commit8d70d3de3842cd079484b8e683516ff291de7e24 (patch)
tree217114c7b88c13a4535ae42e96b332d7d8641f85 /streaming
parentbf58461d365b5cee0d8a80a019a64e84c841f32f (diff)
Fix crash when using UNIX socket (#9036)
Diffstat (limited to 'streaming')
-rw-r--r--streaming/index.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/streaming/index.js b/streaming/index.js
index dd1a8d546..b4d09d0ad 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -642,9 +642,8 @@ const startWorker = (workerId) => {
 const attachServerWithConfig = (server, onSuccess) => {
   if (process.env.SOCKET || process.env.PORT && isNaN(+process.env.PORT)) {
     server.listen(process.env.SOCKET || process.env.PORT, () => {
-      fs.chmodSync(server.address(), 0o666);
-
       if (onSuccess) {
+        fs.chmodSync(server.address(), 0o666);
         onSuccess(server.address());
       }
     });