service

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncInterval = 1 * time.Hour
	SyncCooldown = 30 * time.Minute

	SyncConcurrency = 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncService

type SyncService struct {
	// contains filtered or unexported fields
}

func NewSyncService

func NewSyncService(store *storage.Storage, feedFetcher fetch.FeedFetcher, pageFetcher fetch.PageFetcher) *SyncService

func (*SyncService) Run added in v0.3.2

func (s *SyncService) Run(ctx context.Context) error

func (*SyncService) SyncAllBlogs

func (s *SyncService) SyncAllBlogs() error

Start with the current time and a list of all known blogs. For each blog, compare its syncedAt time to the current time. If the difference is less than SyncCooldown, skip it. Otherwise, check for and sync new content.

func (*SyncService) SyncBlog

func (s *SyncService) SyncBlog(feedURL string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL