Reload gunicorn on CSS/JS changes.
assetcache hashes files on worker startup. We don't really mind a worker reload on asset changes, since that's no worse than the old setup with incrementing numbers. But to make this work smoothly, we listen for changes to the CSS/JS dirs and reload on change.remotes/1693176582716663532/tmp_refs/heads/watchparty
parent
9d3c337eb3
commit
3739567b9d
|
@ -28,3 +28,16 @@ def worker_abort(worker):
|
|||
import os
|
||||
os.abort()
|
||||
|
||||
def config_reload_extra_files():
|
||||
import os
|
||||
extra_files = []
|
||||
asset_dirs = ['files/assets/css/', 'files/assets/js/']
|
||||
|
||||
for dir in asset_dirs:
|
||||
fnames = os.listdir(dir)
|
||||
paths = map(lambda x: dir + x, fnames)
|
||||
extra_files.extend(paths)
|
||||
|
||||
return extra_files
|
||||
|
||||
reload_extra_files = config_reload_extra_files()
|
||||
|
|
Loading…
Reference in New Issue