Просмотр исходного кода

Add NoticeEstablishTunnelTimeout

adam-p 7 лет назад
Родитель
Сommit
6ae5fb2f40
2 измененных файлов с 9 добавлено и 1 удалено
  1. 1 1
      psiphon/controller.go
  2. 8 0
      psiphon/notice.go

+ 1 - 1
psiphon/controller.go

@@ -385,7 +385,7 @@ func (controller *Controller) establishTunnelWatcher() {
 		select {
 		case <-timer.C:
 			if !controller.hasEstablishedOnce() {
-				NoticeAlert("failed to establish tunnel before timeout")
+				NoticeEstablishTunnelTimeout(timeout)
 				controller.SignalComponentFailure()
 			}
 		case <-controller.runCtx.Done():

+ 8 - 0
psiphon/notice.go

@@ -766,6 +766,14 @@ func NoticeLivenessTest(ipAddress string, metrics *livenessTestMetrics, success
 		"success", success)
 }
 
+// NoticeEstablishTunnelTimeout reports that the configured EstablishTunnelTimeout
+// duration was exceeded.
+func NoticeEstablishTunnelTimeout(timeout time.Duration) {
+	singletonNoticeLogger.outputNotice(
+		"EstablishTunnelTimeout", noticeShowUser,
+		"timeout", timeout)
+}
+
 type repetitiveNoticeState struct {
 	message string
 	repeats int