mirror of
https://github.com/prometheus/prometheus
synced 2025-01-13 10:22:46 +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 {
|
select {
|
||||||
case <-time.After(1 * time.Minute):
|
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 {
|
select {
|
||||||
case db.compactc <- struct{}{}:
|
case db.compactc <- struct{}{}:
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user