message: Bugfix: Recursively wait for services to be available.
diff: @@ -234,6 +234,10 @@ export class WorkerService implements core.IWorkerService {
  private async processDocumentWork(docId: string, workType: string) {
  this.getServiceForDoc(docId).then((services) => {
  + if (!services) {
  + // Recursive calling if services are not available yet.
  + this.processDocumentWork(docId, workType);
  + } else {
  switch (workType) {
  case "snapshot":
  const snapshotWork = new SnapshotWork(docId, this.config, services);
  @@ -257,6 +261,7 @@ export class WorkerService implements core.IWorkerService {
  default:
  throw new Error("Unknown work type!");
  }
  + }
  }, (error) => {
  console.log(`Error getting service for ${docId}: ${error}`);
  });
  