Write out a root.json file w/ the last overall refresh date (useful for threads with no comments to still show the "Last Refreshed")
This commit is contained in:
parent
0460771d5d
commit
834c23735d
@ -1,6 +1,6 @@
|
||||
import {getMailboxesToSearch, MailboxIterable} from "../mail/read.ts";
|
||||
import {withClient} from "../mail/client.ts";
|
||||
import type {Message, ThreadData} from "../types.ts";
|
||||
import type {Message, RootData, ThreadData} from "../types.ts";
|
||||
import {AsyncCollection} from "../bones/collection/AsyncCollection.ts";
|
||||
import {sha256} from "../bones/crypto.ts";
|
||||
import {config} from "../config.ts";
|
||||
@ -68,5 +68,16 @@ export async function refreshThreadsEntirely(): Promise<void> {
|
||||
(_, v) => typeof v === 'bigint' ? `${v}` : v)
|
||||
await Bun.write(`${config.dirs.data}/threads/${threadId}.json`, json)
|
||||
}
|
||||
|
||||
const root: RootData = {
|
||||
refresh: {
|
||||
date: now,
|
||||
},
|
||||
}
|
||||
|
||||
await Bun.write(
|
||||
`${config.dirs.data}/root.json`,
|
||||
JSON.stringify(root),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
@ -66,3 +66,9 @@ export type ThreadData = {
|
||||
},
|
||||
comments: ThreadComment[],
|
||||
}
|
||||
|
||||
export type RootData = {
|
||||
refresh?: {
|
||||
date: Date,
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user