Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Latest commit

 

History

History
27 lines (22 loc) · 694 Bytes

other.md

File metadata and controls

27 lines (22 loc) · 694 Bytes

Querying & Events

// Listening for job(s) to Finish when not running on-demand
CrossJobs.Current.JobFinished += (sender, args) =>
{
    args.Job.Name // etc
    args.Success
    args.Exception
}

// Get Current Jobs (this does not include Tasks!)
var jobs = CrossJobs.Current.GetJobs();


// Get Job Logs - All Variables involved are optional filters
var logs = CrossJobs.Current.GetLogs(
    jobName,  // for a specific job
    DateTime.Yesterday, // all logs since this date/time (UTC based)
    errorsOnly // boolean to review logs that errored only
);

Built-In Jobs

JobManager.ScheduleLogTrimmingJob(TimeSpan); // defaults to 30 days if you don't specify