This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +10
-51
lines changed Expand file tree Collapse file tree 5 files changed +10
-51
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ KAFKA_CLIENT_CERT_KEY=$(eval "echo \$${ENV}_KAFKA_CLIENT_CERT_KEY")
28
28
KAFKA_URL=$( eval " echo \$ ${ENV} _KAFKA_URL" )
29
29
ZOO_KEEPER=$( eval " echo \$ ${ENV} _ZOO_KEEPER" )
30
30
TOPIC=$( eval " echo \$ ${ENV} _TOPIC" )
31
- MONGODB_URI=$( eval " echo \$ ${ENV} _MONGODB_URI" )
32
31
33
32
LOG_LEVEL=$( eval " echo \$ ${ENV} _LOG_LEVEL" )
34
33
NODE_ENV=$( eval " echo \$ ${ENV} _NODE_ENV" )
Original file line number Diff line number Diff line change @@ -25,9 +25,9 @@ module.exports = {
25
25
}
26
26
} ,
27
27
DYNAMODB : {
28
- // AWS_ACCESS_KEY_ID: process.env.AWS_ACCESS_KEY_ID || '',
29
- // AWS_SECRET_ACCESS_KEY: process.env.AWS_SECRET_ACCESS_KEY || '',
28
+ AWS_ACCESS_KEY_ID : process . env . AWS_ACCESS_KEY_ID || '' ,
29
+ AWS_SECRET_ACCESS_KEY : process . env . AWS_SECRET_ACCESS_KEY || '' ,
30
30
AWS_REGION : process . env . AWS_REGION || '' ,
31
- IS_LOCAL : process . env . IS_LOCAL === 'true' || 'false'
31
+ IS_LOCAL : process . env . IS_LOCAL || 'false'
32
32
}
33
33
} ;
Original file line number Diff line number Diff line change @@ -21,13 +21,7 @@ const schema = new Schema({
21
21
title : { type : String , required : true } ,
22
22
tcDirectId : {
23
23
type : Number ,
24
- required : true ,
25
- index : {
26
- global : true ,
27
- rangeKey : 'id' ,
28
- project : true ,
29
- name : 'TcDirectIdIndex'
30
- }
24
+ required : true
31
25
} ,
32
26
repoUrl : { type : String , required : true } ,
33
27
repoId : { type : String , required : false } ,
Original file line number Diff line number Diff line change 13
13
const config = require ( 'config' ) ;
14
14
const dynamoose = require ( 'dynamoose' ) ;
15
15
16
-
17
- const awsConfigs = config . DYNAMODB . IS_LOCAL_DB ? {
16
+ dynamoose . AWS . config . update ( {
18
17
accessKeyId : config . DYNAMODB . AWS_ACCESS_KEY_ID ,
19
18
secretAccessKey : config . DYNAMODB . AWS_SECRET_ACCESS_KEY ,
20
19
region : config . DYNAMODB . AWS_REGION
21
- } : {
22
- region : config . DYNAMODB . AWS_REGION
23
- } ;
24
-
25
- dynamoose . AWS . config . update ( awsConfigs ) ;
20
+ } ) ;
26
21
27
- if ( config . DYNAMODB . IS_LOCAL_DB ) {
28
- dynamoose . local ( config . DYNAMODB . DYNAMODB_URL ) ;
22
+ if ( config . DYNAMODB . IS_LOCAL === 'true' ) {
23
+ dynamoose . local ( ) ;
29
24
}
30
25
31
- // dynamoose.AWS.config.update({
32
- // // accessKeyId: config.DYNAMODB.AWS_ACCESS_KEY_ID,
33
- // // secretAccessKey: config.DYNAMODB.AWS_SECRET_ACCESS_KEY,
34
- // region: config.DYNAMODB.AWS_REGION
35
- // });
36
-
37
- // if (config.DYNAMODB.IS_LOCAL === 'true') {
38
- // dynamoose.local();
39
- // }
40
-
41
26
dynamoose . setDefaults ( {
42
27
create : false ,
43
28
update : false
Original file line number Diff line number Diff line change @@ -26,25 +26,6 @@ async function scan(model, scanParams) {
26
26
} ) ;
27
27
}
28
28
29
- /**
30
- * Get single data by scan parameters
31
- * @param {Object } model The dynamoose model to scan
32
- * @param {Object } scanParams The scan parameters object
33
- * @returns {Promise<void> }
34
- */
35
- async function scanOne ( model , scanParams ) {
36
- return await new Promise ( ( resolve , reject ) => {
37
- model . scan ( scanParams ) . consistent ( ) . all ( ) . exec ( ( err , result ) => {
38
- if ( err ) {
39
- reject ( err ) ;
40
- }
41
-
42
- return resolve ( result [ 0 ] ) ;
43
- } ) ;
44
- } ) ;
45
- }
46
-
47
29
module . exports = {
48
- scan,
49
- scanOne
50
- } ;
30
+ scan
31
+ } ;
You can’t perform that action at this time.
0 commit comments