dandroid126 / lemmy-nhl-gdt-bot

GNU General Public License v3.0
0 stars 2 forks source link

Feature request: Configurable time to post the thread #39

Closed rmarquet closed 6 months ago

rmarquet commented 7 months ago

Currently, with single-post setup (one game per post), the software will not create a thread for the game until 1 hour before puck drop. I suggest making this configurable.

Personally, I'd generally want the post to be created early in the day at a set time, such as 8 a.m. local time. I might be in the minority on this, though.

However, an easier option in the interim would be a configurable number of hours, such as 6 hours before puck drop.

dandroid126 commented 7 months ago

Configurable number of hours was added by 3612fce1b235db8370840260700800717adecc91. Setting to a specific time will take more work, as a few things will need to be rewritten. I'll leave this issue up until then.

rmarquet commented 7 months ago

Configurable number of hours was added by 3612fce. Setting to a specific time will take more work, as a few things will need to be rewritten. I'll leave this issue up until then.

Is this working? I have it set to 360 for tonight's Caps game and it hasn't posted. I killed it and restarted the docker command, thinking that would download the newest version if it isn't already present, but the logs are showing that the game is still far off:

Apr 23 16:25:31 nhl-gameday-bot [1]: [INFO] [datetime_util] Game isn't going to start for a long time. Don't create the post yet

Apr 23 16:25:31 nhl-gameday-bot [1]: [DEBUG] [main] List of games is less than 2. Don't make a daily thread.

.env has:

MINUTES_BEFORE_GAME_START_TO_CREATE_POST=360

MINUTES_AFTER_GAME_END_TO_UPDATE_POST=60

LOG_LEVEL=INFO

LOG_FILE_MAX_MB=1

LOG_FILE_BACKUP_COUNT=10

ERROR_BACKUP_COUNT=2

dandroid126 commented 7 months ago

I think you'll need to run the command docker pull ghcr.io/dandroid126/lemmy-nhl-gdt-bot:main and then restart the container. If the image isn't found, it pulls it. But if it is found, it uses the existing image.

dandroid126 commented 6 months ago

Just want to come back here and say that if you want to have your post made at the beginning of the day -- the same time that the daily posts are normally made -- you can set MINUTES_BEFORE_GAME_START_TO_CREATE_POST to a very large value, such as 9999999. Games that are not 'today' are filtered out at the very beginning of the main loop, so it won't make posts for tomorrow's games. It will only make posts for games that are 'today'. If the number is any higher than 1440 (24 hours), posts for all games will always be made at the beginning of the day. I think this should be sufficient to close this issue, since there is a way to do what was requested.