obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

[Bug]: Vault backup interval wrong for high numbers

Open Syphdias opened this issue 2 years ago • 1 comments

Describe the bug

If I set the "Vault backup interval (minutes)" to 35791 everything is fine. If I set the "Vault backup interval (minutes)" to 35792 it saves the setting and tries to commit any changes as often as it can.

Relevant errors (if available)

No response

Steps to reproduce

  • Open settings
  • Go to "Obsidian Git"
  • Enter 35791 for "Vault backup interval (minutes)"
  • Wait one second
  • Delete the 1 at the end of "Vault backup interval (minutes)"
  • Append a 2 at the end of "Vault backup interval (minutes)"

Expected Behavior

Act like the setting was 35791 but wait one more minute.

Addition context

No response

Operating system

Linux

Syphdias avatar Dec 14 '21 14:12 Syphdias

The reason is the max interval duration of 2^31, which is 2147483648. And 35792 * 60 * 1000 = 2147520000 is above that. If I get the time, I will try to find a workaround for these high values.

Vinzent03 avatar Dec 14 '21 15:12 Vinzent03