| 1 | package edu.ucsb.cs156.courses.jobs; | |
| 2 | ||
| 3 | import edu.ucsb.cs156.courses.repositories.GradeHistoryRepository; | |
| 4 | import edu.ucsb.cs156.courses.services.GradeHistoryImportService; | |
| 5 | import edu.ucsb.cs156.courses.services.jobs.JobContext; | |
| 6 | import edu.ucsb.cs156.courses.services.jobs.JobContextConsumer; | |
| 7 | import lombok.AllArgsConstructor; | |
| 8 | import lombok.Getter; | |
| 9 | ||
| 10 | @AllArgsConstructor | |
| 11 | public class UploadGradeDataJob implements JobContextConsumer { | |
| 12 | @Getter private GradeHistoryRepository gradeHistoryRepository; | |
| 13 | @Getter private GradeHistoryImportService gradeHistoryImportService; | |
| 14 | ||
| 15 | private static final int BATCH_SIZE = 1000; | |
| 16 | ||
| 17 | @Override | |
| 18 | public void accept(JobContext ctx) throws Exception { | |
| 19 |
1
1. accept : removed call to edu/ucsb/cs156/courses/services/jobs/JobContext::log → KILLED |
ctx.log("Updating UCSB Grade History Data"); |
| 20 | ||
| 21 |
1
1. accept : removed call to edu/ucsb/cs156/courses/services/GradeHistoryImportService::importGradesFromUrl → KILLED |
gradeHistoryImportService.importGradesFromUrl( |
| 22 | "https://raw.githubusercontent.com/dailynexusdata/grades-data/refs/heads/main/courseGrades.csv", | |
| 23 | ctx, | |
| 24 | BATCH_SIZE); | |
| 25 | ||
| 26 |
1
1. accept : removed call to edu/ucsb/cs156/courses/services/jobs/JobContext::log → KILLED |
ctx.log("Finished updating UCSB Grade History Data"); |
| 27 | } | |
| 28 | } | |
Mutations | ||
| 19 |
1.1 |
|
| 21 |
1.1 |
|
| 26 |
1.1 |