mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 02:48:59 +00:00
chore(stdiscosrv): database writing logging
This commit is contained in:
parent
66fb65b01f
commit
3d59740a0a
@ -214,7 +214,9 @@ func (s *inMemoryStore) calculateStatistics() {
|
||||
|
||||
func (s *inMemoryStore) write() (err error) {
|
||||
t0 := time.Now()
|
||||
log.Println("Writing database")
|
||||
defer func() {
|
||||
log.Println("Finished writing database")
|
||||
if err == nil {
|
||||
databaseWriteSeconds.Set(time.Since(t0).Seconds())
|
||||
databaseLastWritten.Set(float64(t0.Unix()))
|
||||
@ -276,6 +278,7 @@ func (s *inMemoryStore) write() (err error) {
|
||||
|
||||
if os.Getenv("PODINDEX") == "0" {
|
||||
// Upload to S3
|
||||
log.Println("Uploading database")
|
||||
fd, err = os.Open(dbf)
|
||||
if err != nil {
|
||||
log.Printf("Error uploading database to S3: %v", err)
|
||||
@ -285,6 +288,7 @@ func (s *inMemoryStore) write() (err error) {
|
||||
if err := s3Upload(fd); err != nil {
|
||||
log.Printf("Error uploading database to S3: %v", err)
|
||||
}
|
||||
log.Println("Finished uploading database")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user