Commit message (Collapse) | Author | Files | Lines | ||
---|---|---|---|---|---|
12 days | */Makefile: Update again | Runxi Yu | 6 | -14/+45 | |
12 days | *: Further restructuring | Runxi Yu | 11 | -7/+66 | |
12 days | *.go: Move to backend | Runxi Yu | 18 | -2/+4 | |
And adjust Makefiles, admin handbook, and lint.sh accordingly. | |||||
12 days | iadocs: Update IA documentation | Runxi Yu | 10 | -44/+279 | |
12 days | docs: max-width: 50rem; | Runxi Yu | 1 | -1/+1 | |
12 days | docs/admin: Document database setup | Runxi Yu | 1 | -1/+10 | |
12 days | docs/admin: Update protocol information | Runxi Yu | 1 | -3/+2 | |
12 days | iadocs: Cover page update | Runxi Yu | 1 | -5/+5 | |
12 days | {,u}sem.go, ws*.go: Restructure files | Runxi Yu | 5 | -235/+319 | |
12 days | {config,main}.go: Enhance configuration file processing | Runxi Yu | 2 | -8/+124 | |
Implements: https://todo.sr.ht/~runxiyu/cca/5 | |||||
12 days | bench.go: Reformat | Runxi Yu | 1 | -2/+2 | |
12 days | bench.go: Separate connection stage from selection stagev0.1.3 | Runxi Yu | 1 | -2/+10 | |
12 days | bench.go: More realistic benchmark for one course only | Runxi Yu | 1 | -9/+18 | |
12 days | Makefile: BSD Make also supports wildcards in targets | Runxi Yu | 1 | -1/+1 | |
12 days | Makefile: Add sem.go to source file list | Runxi Yu | 1 | -1/+1 | |
12 days | {config,ws}.go, cca.scfg.example: Add perf.course_update_interval | Runxi Yu | 3 | -6/+14 | |
This causes a drastic increase in performance. References: https://todo.sr.ht/~runxiyu/cca/7 | |||||
12 days | {courses,wsm}.go: Use in-memory structure to fetch cgroup, not SQL | Runxi Yu | 2 | -26/+18 | |
12 days | {config,ws}.go, cca.scfg.example: Remove chanPool/SendQ | Runxi Yu | 3 | -59/+0 | |
12 days | ws.go: &usemT{} //exhaustruct:ignore | Runxi Yu | 1 | -1/+1 | |
12 days | ws.go: Check error of populateUserCourseGroups | Runxi Yu | 1 | -1/+4 | |
12 days | wsm.go: Omit comparison to bool constant | Runxi Yu | 1 | -1/+1 | |
12 days | wsm.go: Report error when course doesn't exist | Runxi Yu | 1 | -0/+8 | |
Luckily we encounter a database error before we have the chance to dereference a null pointer. But it's still good practice to check. | |||||
12 days | {courses,sem,ws,wsm}.go: Second step towards an efficient state propagator | Runxi Yu | 4 | -16/+24 | |
References: https://todo.sr.ht/~runxiyu/cca/7 | |||||
12 days | {courses,sem,ws}.go: First step towards an efficient state propagator | Runxi Yu | 3 | -6/+110 | |
References: https://todo.sr.ht/~runxiyu/cca/7 | |||||
12 days | go.sum: go mod tidy (removing old checksums) | Runxi Yu | 1 | -6/+0 | |
12 days | ws.go: Index chanPool by userID, rather than session cookie | Runxi Yu | 1 | -5/+2 | |
12 days | {main,utils,ws}.go: Initialize cancelPool directly too | Runxi Yu | 3 | -25/+1 | |
12 days | Bump dependencies | Runxi Yu | 2 | -3/+9 | |
12 days | {main,ws}.go: Initialize chanPool directly instead of setupChanPool() | Runxi Yu | 2 | -22/+1 | |
It is possible to use var chanPool = make(map[string](*chan string)) directly during declaration, even if it's a global variable. There is no need to call a function to initialize it. | |||||
12 days | courses.go: Reformat | Runxi Yu | 1 | -1/+1 | |
12 days | {courses,wsm}.go: Add getCourseByID | Runxi Yu | 2 | -10/+8 | |
This also deduplicates some code. | |||||
12 days | {courses,wsm}.go: Add (*courseT).decrementSelectedAndPropagate | Runxi Yu | 2 | -24/+15 | |
This is being done quite a few times, so let's make it a function. | |||||
12 days | {courses,ws,wsm}.go: Update userCourseGroups during choose/unchoose | Runxi Yu | 3 | -12/+51 | |
12 days | config.go: Emit warning when fake auth is enabled | Runxi Yu | 1 | -0/+2 | |
12 days | bench.go: Don't close request body | Runxi Yu | 1 | -6/+0 | |
The WebSocket library closes it for us (which is not behavior that I like, but fine). Closing it again causes segmentation faults as Body becomes a null pointer or something like that. | |||||
12 days | {courses,ws}.go: Populate userCourseGroups in a separate function | Runxi Yu | 2 | -32/+35 | |
13 days | {courses,ws}.go: Populate userCourseGroups for each connection | Runxi Yu | 2 | -5/+63 | |
It is way too expensive to query the database every time we need to check whether a user has chosen a course in a group. Since we can (hopefully) guarantee that there is only one usable connection for any given moment and user, we could store this data along with the connection as a local variable in handleConn, which would be eligible for garbage collection when handleConn exits. Here we create the data structures that globally represent courseTypes and courseGroups, and during the initial stages of handleConn, perform database queries to populate userCourseGroups with the groups that the user has already chosen. Note that the HELLO command handler does similar database queries, and as per the TODO listed in the comments, should be moved up here for efficiency. (HELLO also serves as some sort of an initial connection check; this should probably be replaced with WebSocket's native pings.) | |||||
13 days | courses.go, schema.sql: Validate course{Type,Group} in server, not SQL | Runxi Yu | 4 | -30/+45 | |
13 days | *.sql: New schema with ctypes and cgroups | Runxi Yu | 3 | -18/+39 | |