repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
995d7b2
parent
9be8122
author
Eric Bower
date
2023-11-12 16:11:55 +0000 UTC
ready
1 files changed,  +2, -4
M cmd/scripts/file-size-sync/sync.go
+2, -4
 1@@ -1,6 +1,7 @@
 2 package main
 3 
 4 import (
 5+	"encoding/binary"
 6 	"log"
 7 	"os"
 8 
 9@@ -30,15 +31,12 @@ func main() {
10 	picoCfg := config.NewConfigCms()
11 	picoCfg.Logger = logger
12 	picoCfg.DbURL = os.Getenv("DATABASE_URL")
13-	picoCfg.MinioURL = os.Getenv("MINIO_URL")
14-	picoCfg.MinioUser = os.Getenv("MINIO_ROOT_USER")
15-	picoCfg.MinioPass = os.Getenv("MINIO_ROOT_PASSWORD")
16 	picoDb := postgres.NewDB(picoCfg.DbURL, picoCfg.Logger)
17 
18 	posts, err := picoDb.FindPosts()
19 	bail(err)
20 	for _, post := range posts {
21-		post.FileSize = len(post.Text)
22+		post.FileSize = binary.Size([]byte(post.Text))
23 		_, err := picoDb.UpdatePost(post)
24 		bail(err)
25 	}