MCPcopy Create free account
hub / github.com/SethGammon/Citadel / readEntries

Function readEntries

hooks_src/doc-sync.js:74–90  ·  view source on GitHub ↗
(queuePath)

Source from the content-addressed store, hash-verified

72}
73
74function readEntries(queuePath) {
75 if (!fs.existsSync(queuePath)) return { exists: false, entries: [], malformed: 0 };
76 const raw = fs.readFileSync(queuePath, 'utf8');
77 const lines = raw.split('\n').filter(line => line.trim().length > 0);
78 const entries = [];
79 let malformed = 0;
80
81 for (const line of lines) {
82 try {
83 entries.push(JSON.parse(line));
84 } catch {
85 malformed++;
86 }
87 }
88
89 return { exists: true, entries, malformed };
90}
91
92function eventTime(entry) {
93 return entry.timestamp || entry.time || entry.created_at || null;

Callers 1

processDocSyncQueueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected