mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-09 06:24:44 +02:00
Allow /metrics on default port; reduce memory if not enabled
This commit is contained in:
parent
bb3fe4f830
commit
358b344916
9 changed files with 184 additions and 125 deletions
server
|
@ -67,7 +67,7 @@ func (c *fileCache) Write(id string, in io.Reader, limiters ...util.Limiter) (in
|
|||
}
|
||||
c.mu.Lock()
|
||||
c.totalSizeCurrent += size
|
||||
metrics.attachmentsTotalSize.Set(float64(c.totalSizeCurrent))
|
||||
mset(metricAttachmentsTotalSize, c.totalSizeCurrent)
|
||||
c.mu.Unlock()
|
||||
return size, nil
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ func (c *fileCache) Remove(ids ...string) error {
|
|||
c.mu.Lock()
|
||||
c.totalSizeCurrent = size
|
||||
c.mu.Unlock()
|
||||
metrics.attachmentsTotalSize.Set(float64(size))
|
||||
mset(metricAttachmentsTotalSize, size)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue