lms-sync 1.0.39 → 1.0.41

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,6 +50,10 @@ const server = {
50
50
 
51
51
  await db.sequelize.query(`CREATE SEQUENCE IF NOT EXISTS ${db_schema}."Semesters__id_seq"`);
52
52
  await db.sequelize.query(`ALTER SEQUENCE ${db_schema}."Semesters__id_seq" RESTART WITH ${maxIdSems + 1}`);
53
+
54
+ let createdCounter = 0
55
+ let errorCounter = 0
56
+ let uniqueErrors = new Set()
53
57
 
54
58
  let userDefPayload = {
55
59
  email: 'ccci_integrator@gmail.com',
@@ -66,6 +70,18 @@ const server = {
66
70
  defaults: userDefPayload
67
71
  });
68
72
 
73
+ if (createdUser) {
74
+ logger.info(`New User record created ${createdCounter + 1}/${createdCounter + 1}: ${userDefault.email} `);
75
+ createdCounter++;
76
+ } else {
77
+ const errorMsg = `Record User Already Exists: ${userDefault.email} `;
78
+ if (!uniqueErrors.has(errorMsg)) {
79
+ logger.error(`${errorCounter + 1}/${errorCounter + 1}: ${errorMsg}`);
80
+ uniqueErrors.add(errorMsg);
81
+ errorCounter++;
82
+ }
83
+ }
84
+
69
85
  const userMail = await Users.findOne({ where: { email: 'ccci_integrator@gmail.com' } });
70
86
 
71
87
 
@@ -129,11 +145,6 @@ const server = {
129
145
  defaults: campusDefPayload
130
146
  });
131
147
 
132
- let createdCounter = 0
133
- let errorCounter = 0
134
- let uniqueErrors = new Set()
135
-
136
-
137
148
 
138
149
  let uCode = new Set()
139
150
  let uName = new Set()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lms-sync",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "Migration App for MSC LMS",
5
5
  "main": "index.js",
6
6
  "scripts": {