bump version

This commit is contained in:
undefined committed 2024-12-15 01:04:24 +08:00
1 parent 04335f76b7
commit a27e6a98f0
6 files changed
+15 -6

No files matched your search

+3 -2
View File
@@ -603,11 +603,12 @@ export class ProblemModel {
if (options.delSource) await fs.remove(tmpdir);
}
static async export(domainId: string) {
static async export(domainId: string, pidFilter?:string) {
console.log('Exporting problems...');
const tmpdir = path.join(os.tmpdir(), 'hydro', `${Math.random()}.export`);
await fs.mkdir(tmpdir);
const pdocs = await ProblemModel.getMulti(domainId, {}, ProblemModel.PROJECTION_PUBLIC).toArray();
const pdocs = await ProblemModel.getMulti(domainId, pidFilter ? { pid: pidFilter } : {}, ProblemModel.PROJECTION_PUBLIC).toArray();
if (process.env.HYDRO_CLI) logger.info(`Exporting ${pdocs.length} problems`);
for (const pdoc of pdocs) {
if (process.env.HYDRO_CLI) logger.info(`Exporting problem ${pdoc.pid || (`P${pdoc.docId}`)} (${pdoc.title})`);
const problemPath = path.join(tmpdir, `${pdoc.docId}`);