Skip to content

Commit

Permalink
Merge pull request #3245 from getlantern/issue3207
Browse files Browse the repository at this point in the history
Just removed file polling closes #3207
  • Loading branch information
fffw committed Oct 9, 2015
2 parents 31c9bec + c5a4dcc commit b12e321
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
3 changes: 1 addition & 2 deletions src/github.com/getlantern/flashlight/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ func Init(version string) (*Config, error) {
}

m = &yamlconf.Manager{
FilePath: configPath,
FilePollInterval: 1 * time.Second,
FilePath: configPath,
EmptyConfig: func() yamlconf.Config {
return &Config{}
},
Expand Down
2 changes: 1 addition & 1 deletion src/github.com/getlantern/lantern-mobile/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (c *config) updateFrom(buf []byte) error {
}

// Making sure we can actually use this configuration.
if len(newCfg.Client.FrontedServers) > 0 && len(newCfg.Client.MasqueradeSets) > 0 && len(newCfg.TrustedCAs) > 0 {
if len(newCfg.Client.MasqueradeSets) > 0 && len(newCfg.TrustedCAs) > 0 {
if reflect.DeepEqual(newCfg, *c) {
return errConfigurationUnchanged
}
Expand Down
15 changes: 0 additions & 15 deletions src/github.com/getlantern/yamlconf/yamlconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ type Manager struct {
// FilePath: required, path to the config file on disk
FilePath string

// FilePollInterval: how frequently to poll the file for changes, defaults
// to 1 second
FilePollInterval time.Duration

// EmptyConfig: required, factor for new empty Configs
EmptyConfig func() Config

Expand Down Expand Up @@ -146,9 +142,6 @@ func (m *Manager) Init() (Config, error) {
if m.FilePath == "" {
return nil, fmt.Errorf("FilePath must be specified")
}
if m.FilePollInterval == 0 {
m.FilePollInterval = 1 * time.Second
}
m.deltasCh = make(chan *delta)
m.nextCfgCh = make(chan Config)

Expand Down Expand Up @@ -205,14 +198,6 @@ func (m *Manager) processUpdates() {
if err != nil {
continue
}
case <-time.After(m.FilePollInterval):
log.Trace("Read update from disk")
var err error
changed, err = m.reloadFromDisk()
if err != nil {
log.Errorf("Unable to read updated config from disk: %s", err)
continue
}
}

if changed {
Expand Down

0 comments on commit b12e321

Please sign in to comment.