Beispiel #1
0
        private IList <IndexSource> GetFailedLinks(int limit)
        {
            IndexSource indexSourceAlias = null;

            var urls =
                Repository.AsQueryOver(() => indexSourceAlias)
                .Where(() => indexSourceAlias.FailedCount > 0 && indexSourceAlias.NextRetryTime <= DateTime.Now)
                .OrderByAlias(() => indexSourceAlias.EndTime)
                .Desc.Lock(() => indexSourceAlias)
                .Read.Take(limit)
                .List();

            return(urls);
        }
Beispiel #2
0
        private IList <IndexSource> GetUnprocessedLinks(int limit)
        {
            IndexSource indexSourceAlias = null;

            var unprocessedUrls =
                Repository.AsQueryOver(() => indexSourceAlias)
                .Where(() => indexSourceAlias.StartTime == null)
                .OrderByAlias(() => indexSourceAlias.Id)
                .Asc.Lock(() => indexSourceAlias)
                .Read.Take(limit)
                .List();

            return(unprocessedUrls);
        }
Beispiel #3
0
        private IList <IndexSource> GetExpiredLinks(int limit)
        {
            IndexSource indexSourceAlias = null;
            var         endDate          = DateTime.Now.Subtract(pageExpireTimeout);

            var expiredUrls =
                Repository.AsQueryOver(() => indexSourceAlias)
                .Where(() => indexSourceAlias.EndTime <= endDate && indexSourceAlias.FailedCount == 0)
                .OrderByAlias(() => indexSourceAlias.EndTime)
                .Desc.Lock(() => indexSourceAlias)
                .Read.Take(limit)
                .List();

            return(expiredUrls);
        }