GithubHelp home page GithubHelp logo

Max number of events? about ical_to_gcal_sync HOT 4 CLOSED

sje30 avatar sje30 commented on July 24, 2024
Max number of events?

from ical_to_gcal_sync.

Comments (4)

andrewramsay avatar andrewramsay commented on July 24, 2024

There shouldn't be any limits on numbers of events, but because I took some shortcuts writing the code then it could happen. The documentation for that method is here:

"maxResults: integer, Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional."

This script only retrieves upcoming events, and when I was writing it for myself I guess I picked 100 as a value for that parameter because I was sure I'd never have that many scheduled! And I clearly skimped on the logic/error handling too. The script should really be checking for incomplete pages and sending more requests until there are no more available, in which case the total number of events wouldn't matter.

Anyway it seems like it should be pretty straightforward to fix, I might get a chance to do that in the next day or two (or feel free to do it yourself, happy to merge a PR!). A shorter term "fix" would be to increase 100 to something larger, just bear in mind the API docs state you may get incomplete results...

from ical_to_gcal_sync.

andrewramsay avatar andrewramsay commented on July 24, 2024

Just committed a quick fix in c632bd0 that I think should take care of this - I tried running it with maxResults=2 and around 20 upcoming events, and it seems to handle the multiple pages of responses OK.

from ical_to_gcal_sync.

sje30 avatar sje30 commented on July 24, 2024

woah, thanks for the quick update. I will pull and check.

from ical_to_gcal_sync.

sje30 avatar sje30 commented on July 24, 2024

thanks. all working fine here!

from ical_to_gcal_sync.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.