File tree 3 files changed +16
-6
lines changed
3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1
1
start=$( date +%s)
2
2
cd /disks/disk0/p3/production/p3-api/deployment/services/p3_api_service/app/
3
- ./node_modules/pm2/bin/pm2 stop p3-index-worker
3
+
4
+ #
5
+ # Nov 2022 - index worker started by cron
6
+ # instead of doing a clean, we create the file clean_requested so that the worker cron can handle it next time around
7
+
8
+ # ./node_modules/pm2/bin/pm2 stop p3-index-worker
9
+
4
10
# ./node_modules/pm2/bin/pm2 reload p3-api-service
5
- ./bin/p3-clean-completed
11
+ # ./bin/p3-clean-completed
12
+ touch clean_requested
6
13
7
14
for collection in feature_sequence genome genome_amr genome_feature genome_sequence pathway subsystem sp_gene
8
15
do
11
18
done
12
19
13
20
# restart index worker
14
- ./node_modules/pm2/bin/pm2 start p3-index-worker
21
+ # ./node_modules/pm2/bin/pm2 start p3-index-worker
15
22
16
23
# print duration
17
24
echo " Duration: $(( ($(date +% s)- $start )/ 60 )) minutes"
Original file line number Diff line number Diff line change 29
29
"event-stream" : " ^3.3.2" ,
30
30
"express" : " ^4.16.3" ,
31
31
"file-queue" : " ^0.2.1" ,
32
+ "forever" : " ^4.0.3" ,
32
33
"formidable" : " ^1.2.2" ,
33
34
"fs-extra" : " ~0.12.0" ,
34
35
"json-patch" : " ^0.6.1" ,
Original file line number Diff line number Diff line change @@ -9,21 +9,23 @@ function synchronous_backup() {
9
9
local snapshot=$2
10
10
echo " Running Backup: $collection $snapshot "
11
11
12
+ async_key=" $collection .$snapshot .x"
12
13
# fire backup call
13
- curl --silent " $SOLR_URL /admin/collections?action=BACKUP&name=$snapshot /$collection &collection=$collection &location=$BACKUP_DIR &async=$collection . $snapshot "
14
+ curl --silent " $SOLR_URL /admin/collections?action=BACKUP&name=$snapshot /$collection &collection=$collection &location=$BACKUP_DIR &async=$async_key "
14
15
15
16
# status check
16
17
STATUS=" running"
17
18
while [ $STATUS == " running" ]
18
19
do
19
- STATUS=$( curl --silent " $SOLR_URL /admin/collections?action=REQUESTSTATUS&requestid=$collection . $snapshot &wt=json" | grep " state" | sed -e ' s/[{},"]/' ' /g' | cut -d ' :' -f 2 )
20
+ STATUS=$( curl --silent " $SOLR_URL /admin/collections?action=REQUESTSTATUS&requestid=$async_key &wt=json" | grep " state" | sed -e ' s/[{},"]/' ' /g' | cut -d ' :' -f 2 )
20
21
echo " [$( date ' +%m/%d/%Y %H:%M:%S' ) ] $collection $STATUS "
21
22
sleep 2m
22
23
done
23
24
}
24
25
25
26
# stop indexer
26
27
cd /disks/disk0/p3/production/p3-api/deployment/services/p3_api_service/app/
28
+ export PATH=/disks/patric-common/runtime/node-v14.18.0/bin:$PATH
27
29
./node_modules/pm2/bin/pm2 stop p3-index-worker
28
30
29
31
echo " # large collections in asychronous mode"
45
47
done
46
48
47
49
# start indexer
48
- ./node_modules/pm2/bin/pm2 start p3-index-worker
50
+ # ./node_modules/pm2/bin/pm2 start p3-index-worker
You can’t perform that action at this time.
0 commit comments