Read configuration only once, and pass that as State to request handlers #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently a lot of configuration is read as-needed from disk; look for code that calls
env::var. I think it would be better to do this:Stateto request handlers.A little brainstorming:
Arc<Something>so it can be shared across threads.Mutexto make them read-write while shared via anArc.Hm. I'd say the port number and the directory listings are probably the only things I want to keep in the env, and that's negotiable depending on what file type we decided on to hold the other settings.
I'm down to just get rid of the json files completely and consolidate it into something else.
As long as whatever we land on is easy to read, I'm down for whatever.
And hard agree with changing when those settings are read to just one time instead of multiple requests. I need to read up more on shared state so I have a feel on how to implement.
Can this be closed now, or do you want to do something else about it?
Nah, not yet. I still need to move the settings in the
.envto the new config.Once I do that, I'll shut this down.
Ok, finally done. Removed the
envfile completely. All toml all the time..