Browse Source

Add comment on datastore access

mirokuratczyk 5 years ago
parent
commit
b7ae68856b
1 changed files with 7 additions and 0 deletions
  1. 7 0
      ConsoleClient/main.go

+ 7 - 0
ConsoleClient/main.go

@@ -449,6 +449,13 @@ type FeedbackWorker struct {
 // Init implements the Worker interface.
 // Init implements the Worker interface.
 func (f *FeedbackWorker) Init(config *psiphon.Config) error {
 func (f *FeedbackWorker) Init(config *psiphon.Config) error {
 
 
+	// The datastore is not opened here, with psiphon.OpenDatastore,
+	// because it is opened/closed transiently in the psiphon.SendFeedback
+	// operation. We do not want to contest database access incase another
+	// process needs to use the database. E.g. a process running in tunnel
+	// mode, which will fail if it cannot aquire a lock on the database
+	// within a short period of time.
+
 	f.config = config
 	f.config = config
 
 
 	return nil
 	return nil