Allow adjustment of refresh in config

Issue #14 resolved
Anonymous created an issue

We are currently running in to an issue with MEAT where it will still show rooms available that have been booked with Google Calendar. It seems like adjusting the threshold for refresh(I believe it is currently 600 seconds)on the server would mitigate this a great deal.

Comments (6)

  1. Adam Ahmed staff repo owner

    Good idea. I set it high by default to avoid hitting Google's limit on API access.

    If I can't get to this soon, I believe it'd be pretty straightforward to do in a pull request.

    Line 57 in /lib/gapps/datasource.js sets the period to a default. If you change it from:

    this._periodSeconds = defaultUpdateSeconds;


    this._periodSeconds = options && options.refreshPeriodSeconds || defaultUpdateSeconds;

    Then you should be able to add a a "refreshPeriodSeconds" property to your config under "gapps" and it'll be respected.

    Probably needs to be tested, though :) That's where the time will be taken.


  2. Adam Ahmed staff repo owner

    Just curious, what happens below 5 minutes? You hit the GApps API limit? Or does something go wrong with MEAT itself?

    I'd expect the former (10k limit < 12*24 checks per day * 20 rooms) but otherwise if MEAT breaks, it's a bug I should fix.

  3. nick_cunningham

    I haven't parsed through logs, but the web service just goes down. I ssh in and restart the service and it's back up, but goes down ~10 minutes later. This initially happened when I set it to 60 second refresh. I ratcheted it up 60 seconds at a time until it stopped happening(300 seconds). Hardly scientific, but it was repeatable.

    We're definitely under the API threshold(Google raised the Calendar API to 100k/day).

  4. Adam Ahmed staff repo owner

    Thanks for the heads up! I've released with your warning comment in there and see if I can figure out what makes it unstable for the future.

  5. Log in to comment