[WIP] feat: don't disable pings without a license
Created by: dadlerj
Management console and critical config question @slimsag:
(This is obviously still WIP, as I have a bunch of debug statements in here.) I'm seeing some weird behavior where updates to critical config aren't recognized initially on server start. I have to start it, wait for it to load, then shut it down and restart it again for the changes to be propagated.
This seems like a race condition, as my accessing of the critical config is occurring in a function called from a main()
func.
Here's how it works:
- Starting with the default critical-config.json from dev-private (which has a valid
licenseKey
), start up Sourcegraph. As expected, my debug line at https://github.com/sourcegraph/sourcegraph/compare/checks?expand=1#diff-96efb391535cae0b63190f5e23ec0f82R220 correctly printstrue
. - Shut down Sourcegraph
- Update critical-config.json to comment out the
licenseKey
property - Restart Sourcegraph
- My debug line prints out
true
(incorrectly) - Shut down the server, and then restart it
- My debug line prints out
false
(correctly)
Any ideas for how to overcome this? I'm only doing this check one time, at startup, but I could do it lazily instead if this is an inherent limitation of how/when critical config is loaded.
Test plan: