Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
bandinopla committed Sep 22, 2024
1 parent 3544a63 commit 02fc618
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
21 changes: 14 additions & 7 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "tsnd --respawn --clear server/index.ts",
"build": "tsc",
"start": "node server-to-upload/index.js",
"start": "NODE_ENV=production node server-to-upload/index.js",
"build-and-run": "npm run build && npm start",
"exportschema": "graphql-codegen --config codegen.yml && cp ./move-to-frontend/*.* ../client/src/data",
"update-sbd-rank": "node sbd-rank/update-sbdrank-data.js",
Expand All @@ -15,7 +15,7 @@
"repository": {
"type": "git",
"url": "https://github.com/bandinopla/weightxreps-server.git"
},
},
"keywords": [],
"author": "[email protected]",
"license": "GPL-3.0",
Expand All @@ -38,6 +38,7 @@
"graphql-upload": "^12.0.0",
"html-entities": "^2.3.2",
"jsonwebtoken": "^8.5.1",
"lru-cache": "^11.0.1",
"md5": "^2.3.0",
"mysql": "^2.18.1",
"node-emoji": "^2.1.3",
Expand Down
1 change: 1 addition & 0 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ async function startApolloServer( ) {
const server = new ApolloServer({ /*typeDefs, resolvers*/

schema: WXRSchema
, persistedQueries: false
, introspection: process.env.NODE_ENV !== 'production'

, context: ({ req })=>{
Expand Down
6 changes: 4 additions & 2 deletions server/utils/cache.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

import LRUCache from "lru-cache";
import { LRUCache } from "lru-cache";


const $cache = new LRUCache({
maxAge: process.env.NODE_ENV=='production'? 1000 * 60 * 60 : 0
ttl: process.env.NODE_ENV=='production'? 1000 * 60 * 60 : 1,
ttlAutopurge: true,
max: 100,
});


Expand Down

0 comments on commit 02fc618

Please sign in to comment.