Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Commit 1ac2544

Browse files
authored
Merge branch 'master' into micheldiz/fixTravis
2 parents 40453dd + 30fbfe8 commit 1ac2544

File tree

4 files changed

+302
-320
lines changed

4 files changed

+302
-320
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ node_js:
55
sudo: required
66
dist: trusty
77
before_install:
8-
- scripts/install_dgraph.sh
8+
- scripts/install_dgraph.sh
99
script:
10-
- scripts/build.sh
10+
- scripts/build.sh
1111
after_success: npm run coveralls

scripts/functions.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ function quit {
1414

1515
if pgrep -x dgraph > /dev/null
1616
then
17-
while pgrep dgraph;
18-
do
19-
echo "Sleeping for 5 secs so that Dgraph can shutdown."
20-
sleep 5
21-
done
17+
echo "Sleeping for 5 secs so that Dgraph can shutdown."
18+
sleep 5
2219
fi
2320

2421
echo "Clean shutdown done."
@@ -27,7 +24,8 @@ function quit {
2724

2825
function start {
2926
echo -e "Starting Dgraph alpha."
30-
dgraph alpha --acl_secret_file ./scripts/hmac-secret -p data/p -w data/w --lru_mb 4096 --zero localhost:5080 > data/alpha.log 2>&1 &
27+
head -c 1024 /dev/random > data/acl-secret.txt
28+
dgraph alpha -p data/p -w data/w --lru_mb 4096 --zero localhost:5080 --acl_secret_file data/acl-secret.txt > data/server.log 2>&1 &
3129
# Wait for membership sync to happen.
3230
sleep $sleepTime
3331
return 0

src/clientStub.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,10 @@ export class DgraphClientStub {
9191
}
9292

9393
public query(req: Request): Promise<Response> {
94-
/* tslint:disable-next-line */
95-
const headers = Object.assign(
96-
{},
97-
this.options.headers !== undefined ? this.options.headers : {},
98-
);
94+
const headers =
95+
this.options.headers !== undefined
96+
? { ...this.options.headers }
97+
: {};
9998
if (req.vars !== undefined) {
10099
if (this.legacyApi) {
101100
headers["X-Dgraph-Vars"] = JSON.stringify(req.vars);
@@ -227,14 +226,11 @@ export class DgraphClientStub {
227226
} else {
228227
return Promise.reject("Mutation has no data");
229228
}
230-
/* tslint:disable-next-line */
231-
const headers = Object.assign(
232-
{},
233-
this.options.headers !== undefined ? this.options.headers : {},
234-
{
235-
"Content-Type": `application/${usingJSON ? "json" : "rdf"}`,
236-
},
237-
);
229+
230+
const headers = {
231+
...(this.options.headers !== undefined ? this.options.headers : {}),
232+
"Content-Type": `application/${usingJSON ? "json" : "rdf"}`,
233+
};
238234

239235
if (usingJSON && this.legacyApi) {
240236
headers["X-Dgraph-MutationType"] = "json";

0 commit comments

Comments
 (0)