From cc296565ec6f6a2e150ddcafcc4c194a6eb20e48 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 26 Jun 2024 17:18:19 +0800 Subject: [PATCH] 1 --- dbpool.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dbpool.go b/dbpool.go index e57c5c7..26113d1 100644 --- a/dbpool.go +++ b/dbpool.go @@ -130,11 +130,23 @@ func (this *dbPool) SyncBatchLoadFullTable(dataSource string, sqlTpl string, func (this *dbPool) LoopLoad( dataSource string, + watchTable string, + watchTimeCb func() int64, sqlCb func(int64) string, params []string, nextTimeCb func() time.Duration, nextRoundCb func() time.Duration, doCb func(*DataSet) bool) { + { + go func () { + this.RawQuery( + dataSource, + fmt.Sprintf("SELECT MAX(idx) FROM %s", watchTable), + params, + func (err error, ds *DataSet) { + }) + }() + } var lastIdx int64 for true { hasNextData := false