clarify purpose of trialVersion by changing the name to handleTrialDeadline and adding a doc string

This commit is contained in:
Maxton Huff 2021-02-11 16:13:04 -06:00
parent 136a4b8068
commit b89dae01cc
3 changed files with 7 additions and 3 deletions

@ -1 +1 @@
Subproject commit fa773628a276e2590785a87fbc236c7e88ea6284
Subproject commit 28c2313ecfcd7e083d42d4e409483e968b4c421b

View file

@ -285,7 +285,7 @@ func (m *Command) SetupServer() error {
m.logger.Printf("%s", pilosa.VersionInfo())
trialVersion(m.logger)
handleTrialDeadline(m.logger)
// If the pilosa command line uses -tx to override the
// PILOSA_TXSRC env variable, then we must also correct

View file

@ -27,7 +27,11 @@ import (
"github.com/pilosa/pilosa/v2"
)
func trialVersion(logger loggerLogger) {
// handleTrialDeadline checks to see if this is a trial version of Molecula that expires at some point.
// If it is, we contact an NTP server to get the current time and compare that to the trial deadline.
// We launch two goroutines, one which reminds via a log message how much time is left in the trial,
// and one which causes the process to exit once the trial is over.
func handleTrialDeadline(logger loggerLogger) {
if pilosa.TrialDeadline != "" {
startTime, err := ntpServerTime(4, logger)
if err != nil {