TheNetsky / Microsoft-Rewards-Script

Automated Microsoft Rewards script, using TypeScript, Cheerio and Playwright.
133 stars 33 forks source link

New feature (Auto Restart): index.ts & Logger.ts #118

Open xunilalala opened 1 month ago

xunilalala commented 1 month ago

Added the logic for auto-restart: If the child process does not output logs for an extended period (as defined in config.json as restartTime), it will exit abnormally. If the child process exits abnormally, the main process will attempt to fork a new child process with the same account data for a maximum of five attempts.

96 Adding auto-restart

xunilalala commented 1 month ago

When the cluster is set to 1, the runMaster function will still be initiated, creating a main process to supervise the child processes. However, when the cluster is greater than 1, the process overhead remains the same as before.

serzak51 commented 1 month ago

Might be me who isn't using it correcty, but i can't manage to make it work constantly. It often start a new page with about:blank instand of rewards.bing.com, and it almost always doesn't find the password field. Tried to come back to the vanilla script, worked perfectly.

xunilalala commented 1 month ago

@serzak51 Bro, this is a Pull Request. You replied in the wrong place. Please delete your reply after seeing this, and I will delete my reply to you.

I have opened the issue tracker for the repository where this code was submitted. If you have any questions about the automatic restart, please submit an issue there. If you have questions regarding the main repository, please submit an issue to the main repository. In this PR, you can see my changes. I only added the restart logic and did not modify the login part at all.

Let me clarify the logic for you because the information you provided is insufficient for analysis: Rolling back to the main repository code works fine, but this doesn't---> xunilalal keeps restarting?---> Why does it keep restarting?---> The watchdog process restarts the code because it isn't working---> Why isn't the code working?--> Can't find the password field---> Login module issue---> xunilalal's submission didn't touch the login module---> The main repository code itself has this issue------> How to reproduce?----> serzak51 Please try cloning a new copy of the main repository to a new location on your computer and start it to see if there are any issues. If there are, please submit an issue to the main repository. If there are not, please clone a new copy of xunilalal's repository to a new location on your computer, start the code, and observe if there are any issues. If there are, please submit an issue to xunilalal's repository. I will look into it.