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

Write game logs async. Write messages in bulks. #3384

Merged
merged 7 commits into from
Jan 6, 2024
Merged

Conversation

arielj
Copy link
Collaborator

@arielj arielj commented Jan 4, 2024

This PR is a small refactor on how we write game logs to make the write async instead of inline before launching games.

This has a few benefits:

  • games start launching faster since we don't wait for logs to be written
  • if any issue happens while writing to logs, games start anyway

Also, with this change, appended messages are queued and written to disk at 1 second intervals instead of writing them immediately to disk, reducing the amount of writes we do.

Also, with this refactor, we can now include more logs in a single place (the initLog method), unblocking many issues related to adding more information in the logs.


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@arielj arielj added the pr:ready-for-review Feature-complete, ready for the grind! :P label Jan 4, 2024
@arielj arielj requested review from a team, flavioislima, CommandMC, Etaash-mathamsetty, Nocccer and imLinguin and removed request for a team January 4, 2024 00:50
src/backend/logger/logger.ts Outdated Show resolved Hide resolved
src/backend/logger/logger.ts Outdated Show resolved Hide resolved
src/backend/logger/logger.ts Outdated Show resolved Hide resolved
src/backend/logger/logger.ts Outdated Show resolved Hide resolved
src/backend/logger/logger.ts Outdated Show resolved Hide resolved
src/backend/logger/logger.ts Outdated Show resolved Hide resolved
src/backend/logger/logger.ts Outdated Show resolved Hide resolved
@arielj arielj requested a review from CommandMC January 5, 2024 23:49
@arielj arielj requested a review from CommandMC January 6, 2024 02:19
Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

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

Looks god

@arielj arielj merged commit 68c84f2 into main Jan 6, 2024
9 checks passed
@arielj arielj deleted the async-game-logs branch January 6, 2024 23:42
@Heroic-Games-Launcher Heroic-Games-Launcher locked and limited conversation to collaborators Jan 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants