glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
212 stars 51 forks source link

Incorrect next run #674

Closed nchizhov closed 1 month ago

nchizhov commented 1 month ago

Bug reporting acknowledgment

Yes, I read it

Professional support

Yes, I know

Describe the bug

If we will change date on computer to "future" and change time back to normal - glpi-agent will try next run in "future" dates.

To reproduce

1, Change date to future

  1. Try run inventory
  2. Back date to "normal"
  3. In logs now show that next run will be in "future"

Expected behavior

Check current date and next run date - if current date is more lower (for example: months, years, n days) than next run, than "reset" next run date.

Operating system

Windows

GLPI Agent version

1.8

GLPI version

Other (See additional context below), Not applicable

GLPIInventory plugin or other plugin version

No response

Additional context

No response

g-bougard commented 1 month ago

Hi @nchizhov

the scheduling is based on an interval between runs, so the agent is preparing the next date just after it finishes its tasks. If the date is wrong at that time, you make it guesses a wrong future date.

I don't think this is really a problem in normal usage.

If you made a mistake on date setup on the computer, just force the inventory after the date fix. The agent has no way to detect such a mistake.