aniketpanjwani / chomper

Internet blocker for the Linux desktop.
https://addictedto.tech/chomper/
GNU General Public License v3.0
356 stars 43 forks source link

Inconsistencies with time in enacting block. #4

Closed aniketpanjwani closed 6 years ago

aniketpanjwani commented 6 years ago
Steps to reproduce the problem:
  1. Install Chomper.
  2. Go to the ./bin directory and enter ./chomper coding 5.

If the time is currently 10:45:30, you'll get back a message saying the block will be lifted at 10:50:30. However, the block will in fact be lifted at 10:50:00. If you try to create a new block within 10:50:00 and 10:50:30, you will be told that you can't yet create a new block, because the old block is in effect.

Any other comments? What have you tried so far?

This problem is occurring because crontab does not allow for scheduling jobs at a particular second, only at a particular minute. The correct solution is to modify new_block_end in chomper/block.py to round down to the nearest minute.

System information

Operating system: (e.g. Linux Mint 18)