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

Improved start (async/await) #6

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
3 participants
@ags131
Copy link
Contributor

ags131 commented Feb 12, 2018

This is an improved version of the start part of the launcher.

It adds a few helpful features (forwarding console to terminal, better logging structure)
And also adds a few performance improving features (restart interval for runners/processors, option to disable storage when using alternative storage mods)
With Node 8, async/await runs natively, the code is restructured slightly to use them, this simplified some of the code and in general makes promises easier to work with. (I can try refactoring into a PR without async/await if this isn't desirable)

  • Use async/await, this simplifies some of the code
  • Added log_console option, forwards console messages to terminal
  • Changed logs to use a rotating log rather than timestamps, this makes finding the most recent log much easier. (log_rotate_keep (default 5) controls how many to keep)
  • Added a storage_enabled option (default true), this allows storage to be disabled when using a mod such as screepsmod-mongo
  • Added restart_interval (default 3600 seconds (1hr)). This is the interval before runner and processors get restarted.
@artch

This comment has been minimized.

Copy link
Contributor

artch commented Feb 12, 2018

This looks interesting. Do we really need to use async/await here? It'd be the only place in this code base that raises overall minimum requirement to Node.js 8.

@ags131

This comment has been minimized.

Copy link
Contributor Author

ags131 commented Feb 12, 2018

Not really, regular .then usage should work here, I started by modifying the launcher for personal use, I'm always hacking it in node_modules to change some things such as disabling storage and redirecting logs to stdout. I should be able to switch it back though.

As another thought, isolatedVM only compiles for newer node versions last I tried, is that not going to be setting a hard requirement for Node 8 then?

@tedivm

This comment has been minimized.

Copy link

tedivm commented Feb 12, 2018

Due to better performance, and the fact that node8 is the current LTS version, we've already been recommending to people in slack who are running their own servers to use node8. I believe some of the community mods are also targeting node8 and are ignoring backwards compatibility. I really don't think changing this will disrupt much.

@ags131 ags131 changed the title Improved start Improved start (async/await) Feb 12, 2018

Improved launcher
* Use async/await, this simplifies some of the code
* Added log_console option, forwards console messages to terminal
* Changed logs to use a rotating log rather than timestamps, this makes
finding the most recent log much easier. (log_rotate_keep (default 5)
controls how many to keep)
* Added a storage_enabled option (default true), this allows storage
to be disabled when using a mod such as screepsmod-mongo
* Added restart_interval (default 3600). This is the interval before
runner and processors get restarted.

@ags131 ags131 force-pushed the ags131:improvements branch from 48d7ba5 to 99c611d Dec 17, 2018

@ags131

This comment has been minimized.

Copy link
Contributor Author

ags131 commented Dec 17, 2018

Rebased on current launcher master branch

@ags131 ags131 closed this Mar 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.