mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +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) {
|
func (s *inMemoryStore) write() (err error) {
|
||||||
t0 := time.Now()
|
t0 := time.Now()
|
||||||
|
log.Println("Writing database")
|
||||||
defer func() {
|
defer func() {
|
||||||
|
log.Println("Finished writing database")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
databaseWriteSeconds.Set(time.Since(t0).Seconds())
|
databaseWriteSeconds.Set(time.Since(t0).Seconds())
|
||||||
databaseLastWritten.Set(float64(t0.Unix()))
|
databaseLastWritten.Set(float64(t0.Unix()))
|
||||||
@ -276,6 +278,7 @@ func (s *inMemoryStore) write() (err error) {
|
|||||||
|
|
||||||
if os.Getenv("PODINDEX") == "0" {
|
if os.Getenv("PODINDEX") == "0" {
|
||||||
// Upload to S3
|
// Upload to S3
|
||||||
|
log.Println("Uploading database")
|
||||||
fd, err = os.Open(dbf)
|
fd, err = os.Open(dbf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error uploading database to S3: %v", err)
|
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 {
|
if err := s3Upload(fd); err != nil {
|
||||||
log.Printf("Error uploading database to S3: %v", err)
|
log.Printf("Error uploading database to S3: %v", err)
|
||||||
}
|
}
|
||||||
|
log.Println("Finished uploading database")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user