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

Commit

Permalink
only fetch requests from last 7 days (#140)
Browse files Browse the repository at this point in the history
Co-authored-by: ryan_wang5 <[email protected]>
  • Loading branch information
cheesehary and rwang5-atl authored Dec 14, 2021
1 parent 6c9d863 commit f809bbb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/Queue.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { LandRequestStatus, LandRequest, PullRequest } from '../db';
import { Op } from 'sequelize';

export class LandRequestQueue {
public getStatusesForWaitingRequests = async () => {
return LandRequestStatus.findAll<LandRequestStatus>({
where: {
isLatest: true,
state: 'will-queue-when-ready',
// only retrieve requests from last 7 days
date: { [Op.gt]: new Date(new Date().getTime() - 7 * 1000 * 60 * 60 * 24) },
},
order: [['date', 'ASC']],
include: [
Expand Down

0 comments on commit f809bbb

Please sign in to comment.