mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
maxapi: update log message
This commit is contained in:
parent
4766f6c203
commit
c366e98c43
|
@ -39,7 +39,7 @@ const (
|
||||||
// 2018-09-01 08:00:00 +0800 CST
|
// 2018-09-01 08:00:00 +0800 CST
|
||||||
TimestampSince = 1535760000
|
TimestampSince = 1535760000
|
||||||
|
|
||||||
maxAllowedDelayedTimeOffset = -20
|
maxAllowedNegativeTimeOffset = -20
|
||||||
)
|
)
|
||||||
|
|
||||||
var httpTransportMaxIdleConnsPerHost = http.DefaultMaxIdleConnsPerHost
|
var httpTransportMaxIdleConnsPerHost = http.DefaultMaxIdleConnsPerHost
|
||||||
|
@ -174,12 +174,12 @@ func (c *RestClient) queryAndUpdateServerTimestamp(ctx context.Context) {
|
||||||
|
|
||||||
if offset < 0 {
|
if offset < 0 {
|
||||||
// avoid updating a negative offset: server time is before the local time
|
// avoid updating a negative offset: server time is before the local time
|
||||||
if offset > maxAllowedDelayedTimeOffset {
|
if offset > maxAllowedNegativeTimeOffset {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the offset is greater than 15 seconds, we should restart
|
// if the offset is greater than 15 seconds, we should restart
|
||||||
logger.Panicf("max exchange server timestamp offset %d > %d seconds", offset, maxAllowedDelayedTimeOffset)
|
logger.Panicf("max exchange server timestamp offset %d is less than the negative offset %d", offset, maxAllowedNegativeTimeOffset)
|
||||||
}
|
}
|
||||||
|
|
||||||
atomic.StoreInt64(&globalServerTimestamp, serverTs)
|
atomic.StoreInt64(&globalServerTimestamp, serverTs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user