Skip to content

Commit 3e95136

Browse files
fix for config reload performance
1 parent 3739fac commit 3e95136

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

modules/system.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class KaktosConfig(object):
3636
kc = KaktosConfig()
3737

3838
kc.is_debug = is_debug()
39-
kc.config = reload(config)
39+
kc.config = config
4040
kc.frontend = frontend.api
4141
kc.path = path
4242

@@ -88,6 +88,10 @@ def setup():
8888
def build_pages():
8989
print("building site...")
9090

91+
# refresh content data on dev rebuilds so file edits are picked up
92+
if is_debug():
93+
reload(config)
94+
9195
frontend.run_frontend_build()
9296
freezer_app.freeze()
9397
frontend.publish_static_to_build()
@@ -126,6 +130,7 @@ def start_live_reload():
126130
server.watch(lockfile, build_pages)
127131

128132
server.watch(os.path.join(config.root_dir, "modules", "config.py"), build_pages)
133+
server.watch(os.path.join(config.root_dir, "extras"), build_pages)
129134

130135
server.serve(root="build", port=5555)
131136

0 commit comments

Comments
 (0)