Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new sync method #942

Merged
merged 16 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 59 additions & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,32 @@
"assets": "package.json"
},
"dependencies": {
"@babel/eslint-parser": "^7.22.9",
"@babel/eslint-parser": "^7.22.15",
"async-mutex": "^0.4.0",
"body-parser": "^1.20.2",
"cli-spinner": "^0.2.10",
"cors": "^2.8.5",
"csvtojson": "^2.0.10",
"dotenv": "^16.0.3",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"express-joi-validation": "^5.0.1",
"joi": "^17.5.0",
"joi": "^17.11.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"log-update": "^4.0.0",
"multer": "*",
"multer": "^1.4.5-lts.1",
"mysql2": "^2.3.3",
"node-xlsx": "^0.23.0",
"regenerator-runtime": "^0.13.9",
"regenerator-runtime": "^0.13.11",
"rxjs": "^7.8.1",
"sequelize": "^6.32.0",
"socket.io": "^4.6.1",
"sequelize": "^6.33.0",
"socket.io": "^4.7.2",
"sqlite3": "^5.1.6",
"superagent": "^8.0.9",
"toad-scheduler": "^1.6.0",
"uuidv4": "^6",
"winston": "^3.7.2",
"winston-daily-rotate-file": "^4.6.1"
"superagent": "^8.1.2",
"toad-scheduler": "^3.0.0",
"uuidv4": "^6.2.13",
"winston": "^3.11.0",
"winston-daily-rotate-file": "^4.7.1"
},
"devDependencies": {
"@babel/cli": "^7.23.0",
Expand All @@ -72,7 +73,6 @@
"eslint-plugin-es": "^4.1.0",
"eslint-plugin-mocha": "^10.2.0",
"husky": "^8.0.3",

"mocha": "^10.2.0",
"semver": "^7.5.4",
"sinon": "^17.0.0",
Expand Down
3 changes: 3 additions & 0 deletions src/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export default {
dialect: 'sqlite',
storage: `${persistanceFolder}/data.sqlite3`,
logging: false,
dialectOptions: {
busyTimeout: 10000,
},
},
simulator: {
dialect: 'sqlite',
Expand Down
7 changes: 7 additions & 0 deletions src/controllers/governance.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ export const isCreated = async (req, res) => {
if (results) {
return res.json({
created: true,
success: true,
});
} else {
return res.json({
created: false,
success: true,
});
}
} catch (error) {
Expand Down Expand Up @@ -116,6 +118,7 @@ export const createGoveranceBody = async (req, res) => {
return res.json({
message:
'Setting up new Governance Body on this node, this can take a few mins',
success: true,
});
} catch (error) {
res.status(400).json({
Expand All @@ -141,6 +144,7 @@ export const setDefaultOrgList = async (req, res) => {

return res.json({
message: 'Committed this new organization list to the datalayer',
success: true,
});
} catch (error) {
console.trace(error);
Expand All @@ -167,6 +171,7 @@ export const setPickList = async (req, res) => {

return res.json({
message: 'Committed this pick list to the datalayer',
success: true,
});
} catch (error) {
res.status(400).json({
Expand All @@ -191,6 +196,7 @@ export const setGlossary = async (req, res) => {

return res.json({
message: 'Committed glossary to the datalayer',
success: true,
});
} catch (error) {
res.status(400).json({
Expand All @@ -206,6 +212,7 @@ export const sync = async (req, res) => {
Governance.sync();
return res.json({
message: 'Syncing Governance Body',
success: true,
});
} catch (error) {
res.status(400).json({
Expand Down
2 changes: 2 additions & 0 deletions src/controllers/offer.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const importOfferFile = async (req, res) => {

res.json({
message: 'Offer has been imported for review.',
success: true,
});
} catch (error) {
console.trace(error);
Expand Down Expand Up @@ -132,6 +133,7 @@ export const commitImportedOfferFile = async (req, res) => {
res.json({
message: 'Offer Accepted.',
tradeId: response.trade_id,
success: true,
});

await Meta.destroy({
Expand Down
Loading
Loading