Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix assignment uniqueness #6

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/on_push_and_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ jobs:
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm run checkStyle
- run: npm run checkStyle
- run: npm run build
- run: |
if ! [ -f build/start.js ]; then
exit 1;
fi
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WORKDIR /home/node/app
COPY . .

# Install dependencies
RUN npm ci
RUN npm ci --omit=dev

RUN npm run build

Expand Down
103 changes: 87 additions & 16 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"envalid": "^8.0.0",
"express": "^4.18.2",
"fp-ts": "^2.16.7",
"mcv-discord-bot": "file:",
"node-cache": "^5.1.2",
"zod": "^3.23.8"
},
Expand All @@ -25,6 +24,7 @@
"eslint-plugin-unused-imports": "^3.2.0",
"globals": "^15.8.0",
"jest": "^29.7.0",
"jest-mock-extended": "^3.0.7",
"nodemon": "^3.1.4",
"prettier": "^3.3.2",
"prisma": "^5.16.1",
Expand Down
9 changes: 3 additions & 6 deletions src/database/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ const cacheOption = {
stdTTL: 10000, //seconds
deleteOnExpire: true,
}
// const assignmentsRawCache = new NodeCache();
// const coursesRawCache = new NodeCache();

class wrapperCache<T> {
class WrapperCache<T> {
_rawCache = new NodeCache(cacheOption)
set(key: string, value: T) {
this._rawCache.set(key, value)
Expand All @@ -17,6 +15,5 @@ class wrapperCache<T> {
}
}

export const assignmentsCache = new wrapperCache<Assignment>()
export const coursesCache = new wrapperCache<Course>()
// export ={assignmentsCache, coursesCache};
export const assignmentsCache = new WrapperCache<Assignment>()
export const coursesCache = new WrapperCache<Course>()
Loading