Beispiel #1
0
func (sender *Sender) markStopMessageSent(stopMessage models.PendingStopMessage) {
	stopMessage.SentOn = sender.currentTime.Unix()
	sender.stopMessagesToSave = append(sender.stopMessagesToSave, stopMessage)
}
Beispiel #2
0
func (sender *Sender) markStopMessageSent(stopMessage models.PendingStopMessage) {
	stopMessage.SentOn = sender.timeProvider.Time().Unix()
	sender.stopMessagesToSave = append(sender.stopMessagesToSave, stopMessage)
}
			})
		})
	})

	Context("when there are stop messages", func() {
		var keepAliveTime int
		var sentOn int64
		var err error
		var pendingMessage models.PendingStopMessage
		var storeSetErrInjector *fakestoreadapter.FakeStoreAdapterErrorInjector

		JustBeforeEach(func() {
			store.SyncHeartbeats(app.Heartbeat(2))

			pendingMessage = models.NewPendingStopMessage(time.Unix(100, 0), 30, keepAliveTime, app.AppGuid, app.AppVersion, app.InstanceAtIndex(0).InstanceGuid, models.PendingStopMessageReasonInvalid)
			pendingMessage.SentOn = sentOn
			store.SavePendingStopMessages(
				pendingMessage,
			)

			storeAdapter.SetErrInjector = storeSetErrInjector
			err = sender.Send()
		})

		BeforeEach(func() {
			keepAliveTime = 0
			sentOn = 0
			err = nil
			storeSetErrInjector = nil
		})