This commit is contained in:
Jason Kulatunga 2022-10-09 15:01:18 -07:00
parent d89cb920af
commit a4c5168823
2 changed files with 19 additions and 2 deletions

7
docker/README.md Normal file
View File

@ -0,0 +1,7 @@
# Dockerfiles
Note, the context for Dockerfiles in this directory is **always** the repository root.
```bash
docker build -f docker/couchdb/Dockerfile .
```

View File

@ -53,7 +53,7 @@ export class FastenDbService extends PouchdbRepository {
.then((loginResp)=>{ .then((loginResp)=>{
return this.postLoginHook(loginResp.name, true) return this.postLoginHook(loginResp.name, true)
}) })
.catch((err) => console.error("an error occured during login/setup", err)) .catch((err) => console.error("an error occurred during login/setup", err))
} }
/** /**
@ -190,7 +190,17 @@ export class FastenDbService extends PouchdbRepository {
} }
private enableSync(userIdentifier: string){ private enableSync(userIdentifier: string){
console.log("DB sync init...", userIdentifier, this.getRemoteUserDb(userIdentifier)) console.log("DB sync init...", userIdentifier, this.getRemoteUserDb(userIdentifier))
this.replicationHandler = this.localPouchDb.sync(this.getRemoteUserDb(userIdentifier)) this.replicationHandler = this.localPouchDb.sync(this.getRemoteUserDb(userIdentifier), {live: true, retry: true})
.on('paused', function (info) {
// replication was paused, usually because of a lost connection
console.warn("replication was paused, usually because of a lost connection", info)
}).on('active', function (info) {
// replication was resumed
console.warn("replication was resumed", info)
}).on('error', function (err) {
// totally unhandled error (shouldn't happen)
console.error("replication unhandled error (shouldn't happen)", err)
});
console.log("DB sync enabled") console.log("DB sync enabled")
} }