adam-p/danforth-east

Add spreadsheet caching

Opened this issue · 0 comments

I have seen a lot of errors in the demo instance when people are trying to load a page or when the /tasks/members-sheet-cull cron job is running.

BaseHandler exception
Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "/base/data/home/apps/s~mmbrmgmt/1.377551078564221320/tasks.py", line 137, in get
    gapps.cull_members_sheet()
  File "/base/data/home/apps/s~mmbrmgmt/1.377551078564221320/gapps.py", line 364, in cull_members_sheet
    config.MEMBERS_WORKSHEET_KEY)
  File "/base/data/home/apps/s~mmbrmgmt/1.377551078564221320/lib/gdata/spreadsheets/client.py", line 450, in get_list_feed
    **kwargs)
  File "/base/data/home/apps/s~mmbrmgmt/1.377551078564221320/lib/gdata/client.py", line 640, in get_feed
    **kwargs)
  File "/base/data/home/apps/s~mmbrmgmt/1.377551078564221320/lib/gdata/client.py", line 278, in request
    version=get_xml_version(self.api_version))
  File "/base/data/home/apps/s~mmbrmgmt/1.377551078564221320/lib/atom/core.py", line 520, in parse
    tree = ElementTree.fromstring(xml_string)
  File "<string>", line 125, in XML
ParseError: no element found: line 1, column 0

It appears to be inconsistent, however. This suggests that spreadsheet operations need to be moved to a task that can cope with periodic failure (including really long requests).

So, spreadsheet caching not just for performance but reliability.