summaryrefslogtreecommitdiff
path: root/courses.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* {courses,wsm,wsp}.go: Make course.Selected atomicRunxi Yu9 days1-4/+5
|
* *.go: Limit to approximately 80 characters per lineRunxi Yu10 days1-12/+56
|
* {courses,wsc,wsm,wsp}.go: Send course number immediately on user interactionRunxi Yu11 days1-2/+9
|
* *: Overhaul structure again and embed everythingRunxi Yu11 days1-0/+229
| | | | | | | | - Remove sub-Makefiles; recursive make is annoying - Just use one top-level Makefile that builds everything - Embed templates and minified static resources into the binary - Embed all compiled documentation into the binary and serve - Embed all source into the binary and serve
* *.go: Move to backendRunxi Yu11 days1-229/+0
| | | | And adjust Makefiles, admin handbook, and lint.sh accordingly.
* {courses,wsm}.go: Use in-memory structure to fetch cgroup, not SQLRunxi Yu12 days1-17/+6
|
* {courses,sem,ws,wsm}.go: Second step towards an efficient state propagatorRunxi Yu11 days1-4/+6
| | | | References: https://todo.sr.ht/~runxiyu/cca/7
* {courses,sem,ws}.go: First step towards an efficient state propagatorRunxi Yu11 days1-1/+10
| | | | References: https://todo.sr.ht/~runxiyu/cca/7
* courses.go: ReformatRunxi Yu11 days1-1/+1
|
* {courses,wsm}.go: Add getCourseByIDRunxi Yu11 days1-0/+6
| | | | This also deduplicates some code.
* {courses,wsm}.go: Add (*courseT).decrementSelectedAndPropagateRunxi Yu11 days1-0/+11
| | | | This is being done quite a few times, so let's make it a function.
* {courses,ws,wsm}.go: Update userCourseGroups during choose/unchooseRunxi Yu11 days1-7/+18
|
* {courses,ws}.go: Populate userCourseGroups in a separate functionRunxi Yu11 days1-0/+34
|
* {courses,ws}.go: Populate userCourseGroups for each connectionRunxi Yu12 days1-5/+19
| | | | | | | | | | | | | | | | | | 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.)
* courses.go, schema.sql: Validate course{Type,Group} in server, not SQLRunxi Yu12 days1-10/+44
|
* courses.go: Propagate course.Selected when setting up coursesRunxi Yu2024-10-011-2/+7
|
* *: Change license to AGPL-3.0-or-laterRunxi Yu2024-09-301-21/+11
|
* courses.go: courseT.{Lock->SelectedLock}Runxi Yu2024-09-291-12/+12
|
* courses.go: Add a RWMutex to courseTRunxi Yu2024-09-281-8/+15
|
* courses.go, etc: Make courses a map instead of a sliceRunxi Yu2024-09-261-3/+3
| | | | | We need to refer to courses by their ID, and a map makes significantly more sense than a slice.
* *.go, cca.scfg.example: Expose performance optionsRunxi Yu2024-09-261-1/+1
|
* *.go: Wrap errorsRunxi Yu2024-09-261-3/+4
|
* *.go: LintingRunxi Yu2024-09-241-11/+11
|
* courses.go: Comment out coursetype_t enum to make linter happy for nowRunxi Yu2024-09-241-5/+7
|
* *.go: Add more licensesRunxi Yu2024-09-091-0/+30
|
* *.go: Add commentsRunxi Yu2024-09-091-2/+18
|
* courses.go: Remove unused importsRunxi Yu2024-09-081-1/+0
|
* *: Display coursesRunxi Yu2024-09-081-0/+69