Compare commits

...

2 Commits

Author SHA1 Message Date
691012307b
Use streams for tweets
All checks were successful
the build was successful
2018-12-30 08:39:37 +01:00
1453faa2f9
Clean up some error texts 2018-12-29 20:29:56 +01:00
3 changed files with 5 additions and 5 deletions

View File

@ -341,7 +341,7 @@ func performCommands(sub microsub.Microsub, commands []string) {
u := commands[2]
_, err := sub.FollowURL(uid, u)
if err != nil {
log.Fatalf("An error occurred: %s\n", err)
log.Fatalf("ERROR: %s", err)
}
// NOTE(peter): should we show the returned feed here?
}
@ -488,7 +488,7 @@ func importJsonIntoMicrosub(sub microsub.Microsub, filename string) {
feeds, err := sub.FollowGetList(uid)
if err != nil {
log.Fatalf("An error occurred: %q\n", err)
log.Fatalf("An error occurred: %s\n", err)
}
for _, f := range feeds {
@ -500,7 +500,7 @@ func importJsonIntoMicrosub(sub microsub.Microsub, filename string) {
if _, e := feedMap[string(feed)]; !e {
_, err := sub.FollowURL(uid, string(feed))
if err != nil {
log.Printf("An error occurred: %q\n", err)
log.Printf("An error occurred: %s\n", err)
continue
}
log.Printf("Feed followed: %s\n", string(feed))

View File

@ -695,7 +695,7 @@ func Fetch2(fetchURL string) (*http.Response, error) {
client := http.Client{}
resp, err := client.Do(req)
if err != nil {
return nil, fmt.Errorf("error while fetching %s: %s", u, err)
return nil, fmt.Errorf("fetch failed: %s", u, err)
}
defer resp.Body.Close()

View File

@ -34,7 +34,7 @@ type redisStreamTimeline struct {
func (b *memoryBackend) getTimeline(channel string) TimelineBackend {
// TODO: fetch timeline type from channel
timelineType := "sorted-set"
if channel == "notifications" {
if channel == "notifications" || channel == "tweets" {
timelineType = "stream"
}
if timelineType == "sorted-set" {