seems to save toots to disk now
This commit is contained in:
parent
983ff9d35e
commit
46e022c731
@ -456,8 +456,6 @@ func (i *Instance) fetchRecentToots() error {
|
||||
Msgf("unable to parse recent toot list")
|
||||
i.registerError()
|
||||
i.Event("TOOT_FETCH_ERROR")
|
||||
|
||||
fmt.Printf(string(body))
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ import "github.com/sneak/feta/toot"
|
||||
import "github.com/sneak/feta/seeds"
|
||||
import "github.com/sneak/feta/instance"
|
||||
|
||||
const hostDiscoveryParallelism = 20
|
||||
const hostDiscoveryParallelism = 5
|
||||
|
||||
// LogReportInterval defines how long between logging internal
|
||||
// stats/reporting for user supervision
|
||||
|
@ -2,6 +2,7 @@ package storage
|
||||
|
||||
import "errors"
|
||||
import "io/ioutil"
|
||||
import "path/filepath"
|
||||
import "os"
|
||||
import "strings"
|
||||
import "sync"
|
||||
@ -63,6 +64,11 @@ func (ts *TootFSStorage) TootExists(t toot.Toot) bool {
|
||||
func (ts *TootFSStorage) StoreToot(t toot.Toot) error {
|
||||
path := t.DiskStoragePath()
|
||||
full := ts.root + "/" + path
|
||||
dir := filepath.Dir(full)
|
||||
err := os.MkdirAll(dir, 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ioutil.WriteFile(full, t.Original, 0644)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user