Skip to content

Commit

Permalink
chore: remove postgres experiment (#1061)
Browse files Browse the repository at this point in the history
I was trying out postgres to see if it would be a good alternative to
redis.

Unfortunately its slower so its not a good solution.

This PR removes the experimental code.
  • Loading branch information
styfle authored Dec 5, 2024
1 parent bae3403 commit 6b64220
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 321 deletions.
93 changes: 0 additions & 93 deletions api/_initdb.ts

This file was deleted.

162 changes: 3 additions & 159 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"author": "styfle",
"license": "MIT",
"dependencies": {
"@vercel/postgres": "^0.8.0",
"badgen": "^3.2.3",
"ioredis": "^5.4.1",
"lru-cache": "^10.2.0",
Expand Down
3 changes: 1 addition & 2 deletions src/page-props/common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { findOne } from '../util/backend/db';
import { insert as insertPostgres } from '../util/backend/db-postgres';
import { insert as insertRedis } from '../util/backend/db-redis';
import { getAllDistTags } from '../util/npm-api';
import { calculatePackageSize } from '../util/backend/npm-stats';
Expand Down Expand Up @@ -45,7 +44,7 @@ export async function getPkgDetails(
const end = new Date();
const sec = (end.getTime() - start.getTime()) / 1000;
console.log(`Calculated size of ${name}@${version} in ${sec}s`);
await Promise.all([insertRedis(pkgSize), insertPostgres(pkgSize)]);
await insertRedis(pkgSize);
}

const result = {
Expand Down
56 changes: 0 additions & 56 deletions src/util/backend/db-postgres.ts

This file was deleted.

Loading

0 comments on commit 6b64220

Please sign in to comment.