Skip to content

Commit fcf786f

Browse files
committed
iterate
1 parent b6ab13a commit fcf786f

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

agent.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -301,29 +301,11 @@ export const handleExpiredMatches = async () => {
301301
if (match.user1_status === 'accepted' && match.user2_status === 'pending') {
302302
// User 1 accepted but User 2 didn't respond
303303
await sendToolMessage({fid: match.user2_fid, messages: user2Messages, content: "Tell user that their pending connection has been sitting for 24 hours, so it’s \"expired\". If they’re still looking for the right match, they should let you know and so you’ll find someone new."});
304-
await sendToolMessage({fid: match.user1_fid, messages: user1Messages, content: `Tell user that they accepted but ${user2.name} didn't respond in 24 hours so match offer is "expired". It's other user's loss' and you're finding a new match for them.`});
305-
await handleFindMatches({
306-
senderFid: match.user1_fid,
307-
name: user1.name,
308-
messages: user1Messages,
309-
response: {
310-
user_profile: user1.profile,
311-
user_intent: user1.intent
312-
}
313-
});
304+
await sendToolMessage({fid: match.user1_fid, messages: user1Messages, content: `Tell user that they accepted but ${user2.name} didn't respond in 24 hours so match offer is "expired". It's other user's loss'. If they’re still looking for the right match, they should let you know and so you’ll find someone new.`});
305+
314306
} else {
315307
// Neither user responded
316308
await sendToolMessage({fid: match.user1_fid, messages: user1Messages, content: "Tell user that their pending connection has been sitting for 24 hours, so it’s \"expired\". If they’re still looking for the right match, they should let you know and so you’ll find someone new."});
317-
await handleFindMatches({
318-
senderFid: match.user2_fid,
319-
name: user2.name,
320-
messages: user2Messages,
321-
response: {
322-
user_profile: user2.profile,
323-
user_intent: user2.intent
324-
},
325-
notifyOnMatchOnly: true
326-
});
327309
}
328310
}
329311
}

db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export async function findExpiredMatches() {
279279
try {
280280
const expiredMatches = await db('matches')
281281
.where('status', 'pending')
282-
.where('created_at', '<', db.raw("NOW() - INTERVAL '24 hours'"))
282+
.where('updated_at', '<', db.raw("NOW() - INTERVAL '24 hours'"))
283283
.returning('*');
284284

285285
return expiredMatches;

expire.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { handleExpiredMatches } from './agent.js';
33

44
const go = async () => {
55
await handleExpiredMatches()
6+
process.exit(0);
67
}
78

89
go();

0 commit comments

Comments
 (0)