Skip to content

Commit 2bf863e

Browse files
committed
Mongo3.8 does not support max tx lock param
1 parent a47ddf0 commit 2bf863e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/start_mongo.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ mongodb_dir=$(find ${PWD}/ -type d -name "mongodb-linux-x86_64*")
66

77
mkdir $mongodb_dir/data
88

9-
$mongodb_dir/bin/mongod \
10-
--dbpath $mongodb_dir/data \
11-
--logpath $mongodb_dir/mongodb.log \
12-
--fork \
13-
--setParameter maxTransactionLockRequestTimeoutMillis=1000 \
14-
--replSet \
15-
mongoengine
9+
args=(--dbpath $mongodb_dir/data --logpath $mongodb_dir/mongodb.log --fork --replSet mongoengine)
10+
if (( $(echo "$MONGODB > 3.8" | bc -l) )); then
11+
args+=(--setParameter maxTransactionLockRequestTimeoutMillis=1000)
12+
fi
13+
14+
$mongodb_dir/bin/mongod "${args[@]}"
1615

1716
if (( $(echo "$MONGODB < 6.0" | bc -l) )); then
1817
mongo --verbose --eval "rs.initiate()"

0 commit comments

Comments
 (0)