A social RSS reader built on the AT Protocol. glean.at
glean atproto atmosphere rss feed social app
14
fork

Configure Feed

Select the types of activity you want to include in your feed.

Optimize SQLite configuration

+16 -2
+15 -1
internal/db/db.go
··· 18 18 if err := conn.RegisterFunc("log", func(x float64) float64 { return math.Log(x) }, true); err != nil { 19 19 return err 20 20 } 21 + pragmas := []string{ 22 + `PRAGMA wal_autocheckpoint = 1000`, 23 + `PRAGMA temp_store = MEMORY`, 24 + `PRAGMA mmap_size = 268435456`, 25 + } 26 + for _, p := range pragmas { 27 + if _, err := conn.Exec(p, nil); err != nil { 28 + return err 29 + } 30 + } 21 31 return nil 22 32 }, 23 33 }) ··· 46 56 *sql.DB 47 57 } 48 58 59 + func (d *DB) Close() error { 60 + return d.DB.Close() 61 + } 62 + 49 63 func Open(path string) (*DB, error) { 50 - db, err := sql.Open("sqlite3_glean", path+"?_journal_mode=WAL&_busy_timeout=5000") 64 + db, err := sql.Open("sqlite3_glean", path+"?_journal_mode=WAL&_busy_timeout=30000&_synchronous=NORMAL&_cache_size=-64000&_stmt_cache_size=64&_mutex=no") 51 65 if err != nil { 52 66 return nil, err 53 67 }
+1 -1
internal/feed/fetcher.go
··· 120 120 return 121 121 } 122 122 123 - sem := make(chan struct{}, 10) 123 + sem := make(chan struct{}, 3) 124 124 var wg sync.WaitGroup 125 125 for _, f := range feeds { 126 126 wg.Add(1)