Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from terass-inc/feature/exec-parallel
Browse files Browse the repository at this point in the history
並列実行を可能にする対応
  • Loading branch information
koolii authored Mar 1, 2022
2 parents a03a754 + 5b362da commit 9e004f4
Show file tree
Hide file tree
Showing 40 changed files with 127,788 additions and 131 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,3 @@ dist
.tern-port

cache
db
17 changes: 15 additions & 2 deletions bin/server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

const enrichment = require("../main");
const EnrichmentAddress = require("../main");
const http = require("http");

if (process.argv.length < 3 || !process.argv[2].match(/^[1-9][0-9]*$/)) {
Expand All @@ -9,6 +9,7 @@ if (process.argv.length < 3 || !process.argv[2].match(/^[1-9][0-9]*$/)) {
}

const port = parseInt(process.argv[2]);
const enrichment = new EnrichmentAddress();

const server = http.createServer((req, res) => {
if (req.method === "GET") {
Expand Down Expand Up @@ -52,7 +53,7 @@ const server = http.createServer((req, res) => {
return;
}
}
enrichment(input).then(json => {
enrichment.convert(input).then(json => {
res.writeHead(200, {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*"
Expand All @@ -72,3 +73,15 @@ const server = http.createServer((req, res) => {
server.listen(port, () => {
console.log(`imi-enrichment-address-server is running on port ${port}`);
});

server.on("close", () => {
enrichment.disconnect();
});

process.on("SIGINT", () => {
server.close();
});

process.on("SIGTERM", () => {
server.close();
});
Binary file added db/000005.ldb
Binary file not shown.
Binary file added db/000007.ldb
Binary file not shown.
Binary file added db/000009.ldb
Binary file not shown.
Binary file added db/000011.ldb
Binary file not shown.
Binary file added db/000013.ldb
Binary file not shown.
Binary file added db/000015.ldb
Binary file not shown.
Binary file added db/000017.ldb
Binary file not shown.
Binary file added db/000019.ldb
Binary file not shown.
Binary file added db/000021.ldb
Binary file not shown.
Binary file added db/000023.ldb
Binary file not shown.
Binary file added db/000025.ldb
Binary file not shown.
Binary file added db/000027.ldb
Binary file not shown.
Binary file added db/000029.ldb
Binary file not shown.
Binary file added db/000031.ldb
Binary file not shown.
Binary file added db/000034.ldb
Binary file not shown.
Binary file added db/000036.ldb
Binary file not shown.
Binary file added db/000038.ldb
Binary file not shown.
Binary file added db/000040.ldb
Binary file not shown.
Binary file added db/000042.ldb
Binary file not shown.
Binary file added db/000044.ldb
Binary file not shown.
Binary file added db/000046.ldb
Binary file not shown.
Binary file added db/000048.ldb
Binary file not shown.
Binary file added db/000050.ldb
Binary file not shown.
Binary file added db/000052.ldb
Binary file not shown.
Binary file added db/000054.ldb
Binary file not shown.
Binary file added db/000056.ldb
Binary file not shown.
Empty file added db/004710.ldb
Empty file.
1 change: 1 addition & 0 deletions db/CURRENT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MANIFEST-004708
6 changes: 6 additions & 0 deletions db/LOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
2020/01/28-18:31:28.398952 7fe80f7e0700 Recovering log #4707
2020/01/28-18:31:28.474353 7fe80f7e0700 Delete type=0 #4707
2020/01/28-18:31:28.474570 7fe80f7e0700 Delete type=2 #4708
2020/01/28-18:31:28.474796 7fe80f7e0700 Delete type=3 #4706
2020/01/28-18:31:28.475150 7fe80efd0700 Compacting 1@0 + 1@1 files
2020/01/28-18:31:28.476010 7fe80efd0700 compacted to: files[ 6 19 1 0 0 0 0 ]
6 changes: 6 additions & 0 deletions db/LOG.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
2020/01/28-18:31:13.457455 7fe81d3a0700 Recovering log #4705
2020/01/28-18:31:13.494892 7fe81d3a0700 Delete type=0 #4705
2020/01/28-18:31:13.495105 7fe81d3a0700 Delete type=2 #4706
2020/01/28-18:31:13.495302 7fe81d3a0700 Delete type=3 #4704
2020/01/28-18:31:13.495725 7fe80efd0700 Compacting 1@0 + 1@1 files
2020/01/28-18:31:13.497384 7fe80efd0700 compacted to: files[ 6 19 1 0 0 0 0 ]
Binary file added db/MANIFEST-004708
Binary file not shown.
Empty file modified lib/bangou.js
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion lib/find.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const tree = (function(src) {

return root;

})(JSON.parse(require("fs").readFileSync(__dirname + "/../cache/tree.json", "UTF-8")));
})(require('./tree.json'));


// 1. 市区町村の特定
Expand Down
Loading

0 comments on commit 9e004f4

Please sign in to comment.