about summary refs log tree commit diff
diff options
context:
space:
mode:
-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());
       }
     });