#8298 Use jinja caching settings for EW core widgets

v1.11.0
closed
None
General
nobody
2019-06-17
2019-06-06
No

During an upgrade of EasyWidgets from 0.2.dev to 0.3 I saw a few of these errors. Not really a big deal, just a temporary error during a live upgrade. But it did highlight the fact that EW was reading template files from disk that should've been cached. The stack trace seems to miss a few lines, but jinja's is_up_to_date check is running which gives enough of a clue about autoreload being on.

File '/var/local/allura/Allura/allura/templates/widgets/forge_form.html', line 41 in top-level template code
  <div class="grid-{{19 + extra_width}}">{{field.display(**ctx)}}</div>
File '/var/local/env-allura/lib/python2.7/site-packages/EasyWidgets-0.2.dev20150922-py2.7.egg/ew/widget.py', line 45 in display
File '/var/local/env-allura/lib/python2.7/site-packages/EasyWidgets-0.2.dev20150922-py2.7.egg/ew/render.py', line 29 in __call__
File '/var/local/env-allura/lib/python2.7/site-packages/EasyWidgets-0.2.dev20150922-py2.7.egg/ew/render.py', line 55 in template
File '/var/local/env-allura/lib/python2.7/site-packages/EasyWidgets-0.2.dev20150922-py2.7.egg/ew/render.py', line 208 in load
File '/var/local/env-allura/lib/python2.7/site-packages/Jinja2-2.10-py2.7.egg/jinja2/environment.py', line 1122 in is_up_to_date
  return self._uptodate()
File '/var/local/env-allura/lib/python2.7/site-packages/EasyWidgets-0.2.dev20150922-py2.7.egg/ew/render.py', line 204 in <lambda>
File '/usr/lib64/python2.7/genericpath.py', line 54 in getmtime
  return os.stat(filename).st_mtime
OSError: [Errno 2] No such file or directory: '/var/local/env-allura/lib/python2.7/site-packages/EasyWidgets-0.2.dev20150922-py2.7.egg/ew/templates/jinja2/checkbox.html'

Discussion

  • Dave Brondsema

    Dave Brondsema - 2019-06-06
    • status: in-progress --> review
     
  • Dave Brondsema

    Dave Brondsema - 2019-06-06

    db/8298

    Verified by setting auto_reload_templates = False in .ini file, and assert not self._environ.auto_reload at the beginning of Allura's JinjaEngine.load and also within EW's Jinja2Engine.load. Then made sure I didn't get any assertion errors.

     
  • Kenton Taylor - 2019-06-06
    • status: review --> closed
     
  • Kenton Taylor - 2019-06-06

    Merged.

     
  • Dave Brondsema

    Dave Brondsema - 2019-06-17
    • Milestone: unreleased --> v1.11.0
     

Log in to post a comment.