A collection of helper methods to run uSync.Complete commands as scheduled jobs (via hangfire)
RecurringJob.AddOrUpdate<ISyncPublisherScheduler>(
"Publish Site Content", x =>
x.PublishContent(-1, "target", PublishMode.Push,
new SyncSchedulerOptions
{
DependencyFlags = DependencyFlags.IncludeChildren
}, -1),
Cron.Daily());
RecurringJob.AddOrUpdate<ISyncRestorePointScheduler>(
"Create restore point",
x => x.CreateRestorePoint("Daily."),
Cron.Daily());
You need to register add "uSyncHangfire" to your project.
e.g via a composer :
[ComposeAfter(typeof(uSyncPublishComposer))]
public class ScheduledSitePublishComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
// add uSync hangfire support
builder.AdduSyncHangfire();
// your scheduled jobs can be added here....
}
}
See the examples in the repo for more.