mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 00:23:18 +00:00
Reload tsdb blocks every minute (#8340)
* Reload tsdb blocks every minute Signed-off-by: ArthurSens <arthursens2005@gmail.com> * Proteced tsdb with mutex locks Signed-off-by: ArthurSens <arthursens2005@gmail.com>
This commit is contained in:
parent
cd1dafc2fd
commit
7e932637e3
@ -732,6 +732,12 @@ func (db *DB) run() {
|
||||
|
||||
select {
|
||||
case <-time.After(1 * time.Minute):
|
||||
db.cmtx.Lock()
|
||||
if err := db.reloadBlocks(); err != nil {
|
||||
level.Error(db.logger).Log("msg", "reloadBlocks", "err", err)
|
||||
}
|
||||
db.cmtx.Unlock()
|
||||
|
||||
select {
|
||||
case db.compactc <- struct{}{}:
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user