Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# If rlimit_as is defined in the config file then set the limit here.
if config.get('rlimit_as'):
import resource
resource.setrlimit(resource.RLIMIT_AS, (config.get('rlimit_as'),
config.get('rlimit_as')))
# Build assets. If assets.auto_build is True in the config, this will also
# happen on page request. Otherwise, it only happens once at startup here.
assets.build_assets()
# workaround for TGMochiKit initialisation
# https://sourceforge.net/p/turbogears1/tickets/34/
import tgmochikit
from turbogears.widgets.base import register_static_directory
tgmochikit.init(register_static_directory, config)
# Global device class list... a terrible hack, desperately needs deleting
from bkr.server import model
with session.begin():
model.device_classes = [c.device_class for c in model.DeviceClass.query]
log.debug('Application initialised')