Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 1.11 KB

readme.md

File metadata and controls

49 lines (37 loc) · 1.11 KB

uSync.Complete.Hangfire.

A collection of helper methods to run uSync.Complete commands as scheduled jobs (via hangfire)

Example: Push the whole site once a day.

RecurringJob.AddOrUpdate<ISyncPublisherScheduler>(
    "Publish Site Content", x =>
    x.PublishContent(-1, "target", PublishMode.Push,
    new SyncSchedulerOptions
    {
        DependencyFlags = DependencyFlags.IncludeChildren
    }, -1),
    Cron.Daily());

Example: Create A Daily restore point

RecurringJob.AddOrUpdate<ISyncRestorePointScheduler>(
    "Create restore point", 
    x => x.CreateRestorePoint("Daily."), 
    Cron.Daily());

Getting started.

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.

https://github.com/Jumoo/uSync.Complete.Hangfire