Skip to content

Commit

Permalink
remove redis config
Browse files Browse the repository at this point in the history
  • Loading branch information
recap committed Jul 4, 2024
1 parent 65f44b9 commit ef7c0c9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
39 changes: 0 additions & 39 deletions README.dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,6 @@

Please run `prettier --write .` before you make a commit, or let your IDE handle it.

## Using Redis queue option

By default, the waiting room uses a local queue. To switch to Redis, first:
Change line of code in server.js

```javascript
const queue = require("./local-queue.js")
```

to

```javascript
const queue = require("./redis-queue.js")
```

also the queue.\_ commands in server.js need to be awaited. Search the comments for Redis e.g. changing

```javascript
let queuedUsers = queue.pushAndGetQueue(experimentId, userId)
```

to

```javascript
let queuedUsers = await queue.pushAndGetQueue(experimentId, userId)
```

then run a Redis server e.g. with Docker

```shell
docker run --detach redis:7.2.4
```

then rerun the env setup

```shell
node set_env.js > .env
```

## Unit tests

Expand All @@ -49,4 +11,3 @@ The unit tests can be found in the `test` directory. They use Node.js built-in [
npm run test
```

The current tests are to test the local queue implementation in `local-queue.js`. More tests will be added later.
2 changes: 0 additions & 2 deletions set-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@ function getIps(containers, name) {
getContainersInfo()
.then((containers) => {
const postgresIps = getIps(containers, "postgres")
const redisIp = getIps(containers, "redis")
const otreeIps = getIps(containers, "otree")
console.log(`POSTGRES_IPS=${postgresIps}`)
console.log(`REDIS_HOST=${redisIp}`)
console.log(`OTREE_IPS=${otreeIps}`)
console.log(`POSTGRES_USER=${postgresUser}`)
console.log(`POSTGRES_DB=${postgresDb}`)
Expand Down

0 comments on commit ef7c0c9

Please sign in to comment.