Phase 1: lock cron, reload chaud, argon2, providers, IMDb lookup, cache LRU, /health, /metrics, rate limit, UI dark, biome
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { createWriteStream } from 'node:fs';
|
||||
import { rename } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import { Readable } from 'node:stream';
|
||||
import { pipeline } from 'node:stream/promises';
|
||||
import { createGunzip } from 'node:zlib';
|
||||
import { Readable } from 'node:stream';
|
||||
import { join } from 'node:path';
|
||||
import { ROOT, IMDB_DATASETS_BASE, IMDB_RATINGS } from '../config.js';
|
||||
import { IMDB_DATASETS_BASE, IMDB_RATINGS, ROOT } from '../config.js';
|
||||
|
||||
const FILE = 'title.ratings.tsv';
|
||||
|
||||
@@ -18,11 +18,7 @@ export async function syncImdbRatings() {
|
||||
throw new Error(`Failed to fetch ${url}: HTTP ${res.status}`);
|
||||
}
|
||||
|
||||
await pipeline(
|
||||
Readable.fromWeb(res.body),
|
||||
createGunzip(),
|
||||
createWriteStream(tmpPath),
|
||||
);
|
||||
await pipeline(Readable.fromWeb(res.body), createGunzip(), createWriteStream(tmpPath));
|
||||
|
||||
await rename(tmpPath, IMDB_RATINGS);
|
||||
console.log(`Wrote ${IMDB_RATINGS}`);
|
||||
|
||||
Reference in New Issue
Block a user