diff --git a/docker-compose.lateste2e.production.yml b/docker-compose.lateste2e.production.yml index 347a8ff87a..15f2c628e8 100644 --- a/docker-compose.lateste2e.production.yml +++ b/docker-compose.lateste2e.production.yml @@ -96,6 +96,7 @@ services: depends_on: - db - redis + - nats frontend: image: toska/oodikone2-frontend:latest diff --git a/docker-compose.lateste2e.yml b/docker-compose.lateste2e.yml index 4717a6c5ce..9f67854499 100644 --- a/docker-compose.lateste2e.yml +++ b/docker-compose.lateste2e.yml @@ -98,6 +98,7 @@ services: depends_on: - db - redis + - nats frontend: image: toska/oodikone2-frontend:staging diff --git a/services/backend/updater_writer/updater/database_updater.js b/services/backend/updater_writer/updater/database_updater.js index bd5cc94b72..f3bf12300a 100644 --- a/services/backend/updater_writer/updater/database_updater.js +++ b/services/backend/updater_writer/updater/database_updater.js @@ -38,7 +38,7 @@ const updateAttainments = (studyAttainments, transaction) => studyAttainments.ma creditTeachers.length > 0 && Promise.all(creditTeachers.map(cT => CreditTeacher.upsert(cT, { transaction }))) ]) } catch (e) { - console.log(e) + console.log('attainment update failed', e) } }) @@ -61,12 +61,9 @@ const updateStudent = async (student) => { await deleteStudentStudyrights(studentInfo.studentnumber, transaction) // this needs to be done because Oodi just deletes deprecated studyrights from students ( big yikes ) await Student.upsert(studentInfo, { transaction }) - try { await Promise.all(semesterEnrollments.map(SE => SemesterEnrollment.upsert(SE, { transaction }))) - } catch(e) { - console.log(e) - } + if (studyAttainments) await Promise.all(updateAttainments(studyAttainments, transaction)) if (studyRights) await Promise.all(updateStudyRights(studyRights, transaction)) diff --git a/services/oodikone2-frontend/src/components/CreditAccumulationGraph/index.jsx b/services/oodikone2-frontend/src/components/CreditAccumulationGraph/index.jsx index 56d52f3478..d4b3bd7c5d 100644 --- a/services/oodikone2-frontend/src/components/CreditAccumulationGraph/index.jsx +++ b/services/oodikone2-frontend/src/components/CreditAccumulationGraph/index.jsx @@ -126,7 +126,7 @@ class CreditAccumulationGraph extends Component { .filter(c => moment(c.date).isSameOrAfter(moment(startDate))) let totalCredits = 0 - return filteredCourses.map((c) => { + return _.orderBy(filteredCourses, ['date'], ['asc']).map((c) => { const { course, date, credits, grade, passed, isStudyModuleCredit } = c diff --git a/services/updater_api/doo_api_database_updater/oodi_interface.js b/services/updater_api/doo_api_database_updater/oodi_interface.js index a52e4d966e..bd253119ea 100644 --- a/services/updater_api/doo_api_database_updater/oodi_interface.js +++ b/services/updater_api/doo_api_database_updater/oodi_interface.js @@ -36,7 +36,7 @@ const attemptGetFor = async (url, attempts = 5) => { attempt += 1 try { response = await getUrl(url) - logger.info('requested url', { url, status: response.status }) + logger.info('requested url', { url, success: response.status === 200 }) return response } catch (error) { if (attempt === attempts) { @@ -63,7 +63,7 @@ console.log(process.env.NODE_ENV) const getStudent = async studentNumber => { const url = `${base_url}/students/${studentNumber}/info` try { - const response = await getUrl(url) + const response = await attemptGetFor(url) const data = response.data.data return data } catch (e) { diff --git a/services/updater_api/logger.js b/services/updater_api/logger.js index caa3b72faf..09394083e5 100644 --- a/services/updater_api/logger.js +++ b/services/updater_api/logger.js @@ -16,8 +16,6 @@ if (process.env.NODE_ENV !== 'test') { transports.push(new winston.transports.File({ filename: 'debug.log' })) } -transports.push(new winston.transports.Console({ level: 'debug' })) - const logger = winston.createLogger({ transports })