mirror of
https://github.com/xtr-dev/rondevu-server.git
synced 2025-12-12 03:43:23 +00:00
Remove unused heartbeat endpoint and storage method
- Removed PUT /offers/:offerId/heartbeat endpoint - Removed updateOfferLastSeen() from storage interface and implementations - last_seen column is still in DB but not used for cleanup - Cleanup only uses expires_at, so heartbeat was non-functional 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -155,14 +155,6 @@ export class D1Storage implements Storage {
|
||||
return this.rowToOffer(result as any);
|
||||
}
|
||||
|
||||
async updateOfferLastSeen(offerId: string, lastSeen: number): Promise<void> {
|
||||
await this.db.prepare(`
|
||||
UPDATE offers
|
||||
SET last_seen = ?
|
||||
WHERE id = ? AND expires_at > ?
|
||||
`).bind(lastSeen, offerId, Date.now()).run();
|
||||
}
|
||||
|
||||
async deleteOffer(offerId: string, ownerPeerId: string): Promise<boolean> {
|
||||
const result = await this.db.prepare(`
|
||||
DELETE FROM offers
|
||||
|
||||
@@ -176,16 +176,6 @@ export class SQLiteStorage implements Storage {
|
||||
return this.rowToOffer(row);
|
||||
}
|
||||
|
||||
async updateOfferLastSeen(offerId: string, lastSeen: number): Promise<void> {
|
||||
const stmt = this.db.prepare(`
|
||||
UPDATE offers
|
||||
SET last_seen = ?
|
||||
WHERE id = ? AND expires_at > ?
|
||||
`);
|
||||
|
||||
stmt.run(lastSeen, offerId, Date.now());
|
||||
}
|
||||
|
||||
async deleteOffer(offerId: string, ownerPeerId: string): Promise<boolean> {
|
||||
const stmt = this.db.prepare(`
|
||||
DELETE FROM offers
|
||||
|
||||
@@ -80,13 +80,6 @@ export interface Storage {
|
||||
*/
|
||||
getOfferById(offerId: string): Promise<Offer | null>;
|
||||
|
||||
/**
|
||||
* Updates the last_seen timestamp for an offer (heartbeat)
|
||||
* @param offerId Offer identifier
|
||||
* @param lastSeen New last_seen timestamp
|
||||
*/
|
||||
updateOfferLastSeen(offerId: string, lastSeen: number): Promise<void>;
|
||||
|
||||
/**
|
||||
* Deletes an offer (with ownership verification)
|
||||
* @param offerId Offer identifier
|
||||
|
||||
Reference in New Issue
Block a user