fix: 修正导出的时间含义
This commit is contained in:
parent
0444df3b4c
commit
7f4b8bb18b
@ -61,9 +61,9 @@ func (e *Exporter) Start(ctx context.Context) error {
|
||||
}
|
||||
|
||||
now := time.Now().In(e.loc)
|
||||
// 下一个10分钟边界 + 1分30秒
|
||||
next := alignToNextBucketEnd(now, 10).Add(90 * time.Second)
|
||||
e.logger.Printf("调度: 当前=%s, 下次执行=%s (延迟1分30秒)", now.Format("2006-01-02 15:04:05"), next.Format("2006-01-02 15:04:05"))
|
||||
// 下一个10分钟边界 + 10秒
|
||||
next := alignToNextBucketEnd(now, 10).Add(10 * time.Second)
|
||||
e.logger.Printf("调度: 当前=%s, 下次执行=%s (延迟10秒)", now.Format("2006-01-02 15:04:05"), next.Format("2006-01-02 15:04:05"))
|
||||
delay := time.Until(next)
|
||||
if delay > 0 {
|
||||
timer := time.NewTimer(delay)
|
||||
@ -204,9 +204,9 @@ func (e *Exporter) exportBucket(ctx context.Context, bucketStart, bucketEnd time
|
||||
processedStationIDs[stationID] = true
|
||||
e.logger.Printf("处理站点: station_id=%s, device_id=%s, 经度=%.6f, 纬度=%.6f", stationID, deviceID, lon.Float64, lat.Float64)
|
||||
|
||||
// 使用桶开始时间作为date_time
|
||||
dateTimeStr := bucketStartTS.In(e.loc).Format("2006-01-02 15:04:05")
|
||||
e.logger.Printf("站点 %s: 使用时间=%s", stationID, dateTimeStr)
|
||||
// CSV 使用桶末时间作为 date_time(用于表意 10 分钟区间的右端点)
|
||||
dateTimeStr := bucketEnd.In(e.loc).Format("2006-01-02 15:04:05")
|
||||
e.logger.Printf("站点 %s: 写出时间(桶末)=%s,用于 ZTD 对齐参考", stationID, dateTimeStr)
|
||||
|
||||
var pressureStr, tempStr, wsStr, wdStr, rhStr string
|
||||
if pX100.Valid {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user