Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
P
px3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangmingming
px3
Commits
86ecf45b
Commit
86ecf45b
authored
Apr 24, 2024
by
wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
f9
parent
5778036d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
poolStart.js
src/poolStart.js
+22
-0
run.js
src/run.js
+1
-1
No files found.
src/poolStart.js
View file @
86ecf45b
import
{
MongoClient
}
from
"mongodb"
;
import
{
ThreadPool
}
from
"./ThreadPool.js"
;
// const uri = "mongodb://lcc-spider:JIUsfhiad&^@54.183.159.9:27017/?authSource=admin&directConnection=true";
//
//
// const client = new MongoClient(uri);
// const database = client.db("env");
// const movies = database.collection("env_shape");
// // Query for a movie that has the title 'The Room'
// const query = {
// 'env.funcs': {$ne: null},
// };
//
// // Execute query
// const movie = await movies.aggregate([
// {$match: query},
// {$sample: {size: 1}}
// ])
// let res = await movie.toArray()
// console.log(res)
const
pool
=
new
ThreadPool
(
5
);
let
data
=
{
name
:
'你好'
}
...
...
src/run.js
View file @
86ecf45b
...
...
@@ -7,7 +7,7 @@ import * as fs from "fs";
let
ENVS
=
JSON
.
parse
(
fs
.
readFileSync
(
'./env.json'
,
'utf-8'
).
toString
())
let
keys
=
Object
.
keys
(
ENVS
);
const
uri
=
"mongodb://lcc-spider:JIUsfhiad&^@54.183.159.9:27017/?authSource=admin&directConnection=true"
;
const
client
=
new
MongoClient
(
uri
);
//
const client = new MongoClient(uri);
log4js
.
levels
.
INFO
.
colour
=
'white'
;
// console.log(log4js.levels.INFO.colour);
log4js
.
configure
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment