Merge branch 'write_read_executor' into integration

This commit is contained in:
J. Nick Koston 2023-11-18 08:58:43 -06:00
commit ab45364209
No known key found for this signature in database

View file

@ -757,9 +757,15 @@ class EditRequestHandler(BaseHandler):
@authenticated
@bind_config
def post(self, configuration=None):
with open(file=settings.rel_path(configuration), mode="wb") as f:
async def post(self, configuration=None):
# Atomic write
config_file = settings.rel_path(configuration)
with open(file=config_file, mode="wb") as f:
f.write(self.request.body)
await async_run_system_command(
[*DASHBOARD_COMMAND, "compile", "--only-generate", config_file]
)
self.set_status(200)