Skip to content

Conversation

@Pankraz76
Copy link
Contributor

Signed-off-by: Vincent Potucek <vpotucek@me.com>
}

function getInstanceId() {
const args = process.argv.slice(2);
Copy link
Contributor Author

@Pankraz76 Pankraz76 Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considering this unused coupling as inlineable and cast away like Wilson. also random magic number.

let instanceId;

args.forEach(arg => {
process.argv.slice(2).forEach(arg => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more cohesion less coupling. now the 2 and 1 is kind of related making it a little less magic.

}
});
});
const shutdown = shutdownServer(listener, {
Copy link
Contributor Author

@Pankraz76 Pankraz76 Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considering this unused coupling as inlineable and cast away like Wilson.

await shutdownServer(listener, {
forceExit: false, // let the event loop clear
finally: () => debugLog("graceful shutdown finished."),
})();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for JS pros—creating a function inline and directly. In my opinion, this is logically equivalent, but I’m not a pro.

@@ -1,26 +1,26 @@
import shutdownServer from 'http-graceful-shutdown';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first things first, also workaround-fixing the comment bug in rewrite.

import fs from 'fs';

//
// this file will be glued to the top of the specific xy-serve.js file
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could undo but making this info a little more bold as this is quite unique imho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant