// Register registers the anchor event synchronization task.
Register registers the anchor event synchronization task.
// Register registers the anchor event synchronization task .
func Register(cfg Config, taskMgr taskManager, apClient activityPubClient, apStore store.Store,
	storageProvider storage.Provider, handlerFactory func() spi.InboxHandler) error {
	interval := cfg.Interval
	if interval == 0 {
		interval = defaultInterval
	}
	minActivityAge := cfg.MinActivityAge
	if minActivityAge == 0 {
		minActivityAge = defaultMinActivityAge
	}
	t, err := newTask(cfg.ServiceIRI, apClient, apStore, storageProvider, minActivityAge, handlerFactory)
	if err != nil {
		return fmt.Errorf("create task: %w", err)
	}
	logger.Infof("Registering activity-sync task - ServiceIRI: %s, Interval: %s, MinActivityAge: %s.",
		cfg.ServiceIRI, interval, minActivityAge)
	taskMgr.RegisterTask(taskName, interval, t.run)
	return nil
}
func Register ( cfg Config , taskMgr taskManager , apClient activityPubClient , apStore store . Store , storageProvider storage . Provider , handlerFactory func ( ) spi . InboxHandler ) error { interval := cfg . Interval if interval == 0 { interval = defaultInterval } minActivityAge := cfg . MinActivityAge if minActivityAge == 0 { minActivityAge = defaultMinActivityAge } t , err := newTask ( cfg . ServiceIRI , apClient , apStore , storageProvider , minActivityAge , handlerFactory ) if err != nil { return fmt . Errorf ( " " , err ) } logger . Infof ( " " , cfg . ServiceIRI , interval , minActivityAge ) taskMgr . RegisterTask ( taskName , interval , t . run ) return nil }
Register registers the anchor event synchronization task.
Register registers the anchor event synchronization task .