This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cluster.setupPrimary({ | |
exec: resolve(__dirname, 'features/process.js') | |
}) | |
const works: Array<{ | |
work: Worker; | |
tasks: Array<imageType> | |
}> =[] | |
if (list.length <= cpuNums) { | |
works.push({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IdeepFindImg { | |
(path: string): Array<imageType> | |
} | |
let deepFindImg: IdeepFindImg | |
deepFindImg = (path: string) => { | |
const content = fs.readdirSync(path) | |
let images: Array<imageType> = [] | |
content.forEach(folder => { | |
const filePath = resolve(path, folder) | |
const info = fs.statSync(filePath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IcompressSvga { | |
(path: string, source: Buffer): () => Promise<Idetail> | |
} | |
let compressSvga: IcompressSvga | |
compressSvga = (path, source) => { | |
return async () => { | |
const result = { | |
input: 0, | |
output: 0, | |
ratio: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IcompressSvga { | |
(path: string, source: Buffer): () => Promise<Idetail> | |
} | |
let compressSvga: IcompressSvga | |
compressSvga = (path, source) => { | |
return async () => { | |
const result = { | |
input: 0, | |
output: 0, | |
ratio: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IcompressSvga { | |
(path: string, source: Buffer): () => Promise<Idetail> | |
} | |
let compressSvga: IcompressSvga | |
compressSvga = (path, source) => { | |
return async () => { | |
const result = { | |
input: 0, | |
output: 0, | |
ratio: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test(callback) { | |
try { | |
return callback(); | |
} catch (e) { | |
console.log(e); | |
throw e; | |
} | |
return 20; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Xlog: | |
gc*, | |
safepoint, | |
gc+heap=debug, | |
gc+ergo*=trace, | |
gc+age*=trace, | |
:file=/var/log/%t-gc.log | |
:time,tags,level | |
:filecount=5,filesize=10M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Xlog: | |
gc*, | |
safepoint, | |
gc+heap=debug, | |
gc+ergo*=trace, | |
gc+age*=trace, | |
:file=/var/log/%t-gc.log | |
:time,tags,level | |
:filecount=5,filesize=10M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--add-opens java.base/java.lang=ALL-UNNAMED | |
--add-opens java.base/java.io=ALL-UNNAMED | |
--add-opens java.base/java.math=ALL-UNNAMED | |
--add-opens java.base/java.net=ALL-UNNAMED | |
--add-opens java.base/java.nio=ALL-UNNAMED | |
--add-opens java.base/java.security=ALL-UNNAMED | |
--add-opens java.base/java.text=ALL-UNNAMED | |
--add-opens java.base/java.time=ALL-UNNAMED | |
--add-opens java.base/java.util=ALL-UNNAMED | |
--add-opens java.base/jdk.internal.access=ALL-UNNAMED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--add-opens java.base/java.lang=ALL-UNNAMED | |
--add-opens java.base/java.io=ALL-UNNAMED | |
--add-opens java.base/java.math=ALL-UNNAMED | |
--add-opens java.base/java.net=ALL-UNNAMED | |
--add-opens java.base/java.nio=ALL-UNNAMED | |
--add-opens java.base/java.security=ALL-UNNAMED | |
--add-opens java.base/java.text=ALL-UNNAMED | |
--add-opens java.base/java.time=ALL-UNNAMED | |
--add-opens java.base/java.util=ALL-UNNAMED | |
--add-opens java.base/jdk.internal.access=ALL-UNNAMED |