Procházet zdrojové kódy

Add comment on datastore access

mirokuratczyk před 5 roky
rodič
revize
b7ae68856b
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      ConsoleClient/main.go

+ 7 - 0
ConsoleClient/main.go

@@ -449,6 +449,13 @@ type FeedbackWorker struct {
 // Init implements the Worker interface.
 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
 
 	return nil