예제 #1
0
        /// <summary>
        /// Create a new job for the queue.
        /// </summary>
        /// <param name="userId">ASP.NET Identity User Id</param>
        /// <param name="activityId">Optional Strava activity id</param>
        /// <returns></returns>
        public static DownloadQueue CreateQueueJob(string userId, DownloadType type, long?activityId, int?duration)
        {
            DownloadQueue q = new DownloadQueue();

            q.UserId       = userId;
            q.DownloadType = type;
            q.ActivityId   = activityId;

            q.Added       = DateTime.Now;
            q.Processed   = false;
            q.ProcessedAt = null;
            q.HasError    = false;
            q.Duration    = duration;
            return(q);
        }
예제 #2
0
 public static DownloadQueue CreateQueueJob(string userId, DownloadType type)
 {
     return(DownloadQueue.CreateQueueJob(userId, type, null));
 }
예제 #3
0
 internal static DownloadQueue CreateQueueJob(DownloadQueue job)
 {
     return(CreateQueueJob(job.UserId, job.DownloadType, job.ActivityId, job.Duration));
 }