Changeset b1875f5 in rattail-demo for rattail_demo/web/app.py


Ignore:
Timestamp:
03/03/19 13:10:08 (12 months ago)
Author:
Lance Edgar <ledgar@…>
Branches:
master
Children:
b0b7fc4
Parents:
520940b
Message:

Add support for simple postgres restart

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rattail_demo/web/app.py

    r520940b rb1875f5  
    1515    This function returns a Pyramid WSGI application.
    1616    """
    17     # set some defaults for postgres
    18     app.provide_postgresql_settings(settings)
    19 
    2017    # prefer demo templates over tailbone
    2118    settings.setdefault('mako.directories', ['rattail_demo.web:templates',
    2219                                             'tailbone:templates',])
     20
     21    # for graceful handling of postgres restart
     22    settings.setdefault('retry.attempts', 2)
    2323
    2424    # make config objects
     
    3535    pyramid_config.include('rattail_demo.web.views')
    3636
     37    # for graceful handling of postgres restart
     38    pyramid_config.add_tween('tailbone.tweens.sqlerror_tween_factory',
     39                             under='pyramid_tm.tm_tween_factory')
     40
    3741    return pyramid_config.make_wsgi_app()
Note: See TracChangeset for help on using the changeset viewer.