insanum / gcalcli

Google Calendar Command Line Interface
MIT License
3.31k stars 311 forks source link

Events found 4 minutes after #593

Closed triangle-stream closed 3 years ago

triangle-stream commented 3 years ago

Hello and thank you for this beatiful project.

I'm using gcalcli on a Raspi4 in a radio environment.

I have a little bash script that asks to Google Calendar if there is some event ("start" or "stop") and - if yes - it executes a command (starts an Icecast transmission).

Here's the script: /usr/bin/gcalcli agenda $(date +%R) $(date -d "now + 1 min" +%R) > /home/pi/test.txt [check events from now to 1 minute];

OUTPUT=$(cat /home/pi/test.txt)

if echo "$OUTPUT" | grep -q "start"
  then
    if ! pgrep -x "butt" > /dev/null
        then export DISPLAY=:0 && /usr/bin/butt
    fi
fi
if echo "$OUTPUT" | grep -q "stop"
        then pkill butt
fi

The problem I'm seeing is that, sometimes (really seems to be random), the calendar event is fired 4 minutes before (exactly 4 minutes) and, when i check logs, the event "start" scheduled for 7:00PM shows up in gcalcli at 6:56PM.

I think it could be a Google issue because removing one of those events (that was repetitive - each day at the same hour) and recreating it seems to fix the issue, until now.

Does anyone has any idea?

Thank you!

triangle-stream commented 3 years ago

Reinstalling on a clean VPS solved the issue.