mirror of
https://git.cyberia.club/cyberia/matrix-synapse-diskspace-janitor
synced 2024-05-31 14:52:12 +02:00
first working version
This commit is contained in:
parent
4a23f8a26e
commit
b1553165c0
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
janitor
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"DatabaseType": "postgres",
|
||||
"DatabaseConnectionString": "host=localhost port=5432 user=postgres password=dev database=synapse sslmode=disable"
|
||||
"DatabaseConnectionString": "host=localhost port=5432 user=synapse_user password=changeme database=synapse sslmode=disable"
|
||||
}
|
1
main.go
1
main.go
|
@ -39,6 +39,7 @@ func main() {
|
|||
rowCounter += 1
|
||||
if updateCounter > 10000 {
|
||||
if time.Now().After(lastUpdateTime.Add(time.Second)) {
|
||||
lastUpdateTime = time.Now()
|
||||
percent := int((float64(rowCounter) / float64(stream.EstimatedCount)) * float64(100))
|
||||
log.Printf("%d/%d (%d%s) ... \n", rowCounter, stream.EstimatedCount, percent, "%")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue