PostStartup runs anything that relies on SG being fully started (i.e. sgreplicate)
()
| 256 | |
| 257 | // PostStartup runs anything that relies on SG being fully started (i.e. sgreplicate) |
| 258 | func (sc *ServerContext) PostStartup() { |
| 259 | // Delay DatabaseContext processes starting up, e.g. to avoid replication reassignment churn when a Sync Gateway Cluster is being initialized |
| 260 | // TODO: Consider sc.WaitForRESTAPIs for faster startup? |
| 261 | time.Sleep(5 * time.Second) |
| 262 | close(sc.hasStarted) |
| 263 | } |
| 264 | |
| 265 | // serverContextStopMaxWait is the maximum amount of time to wait for |
| 266 | // background goroutines to terminate before the server is stopped. |