mailery 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4816,7 +4816,7 @@ async function runSetupChecks(mailer) {
4816
4816
  const checks = [];
4817
4817
  checks.push(await checkMongo(mailer));
4818
4818
  checks.push(await checkQueue(mailer));
4819
- if (mailer.config.queue.driver !== "noop" && !mailer.config.workerless) {
4819
+ if (mailer.config.queue.driver !== "noop") {
4820
4820
  checks.push(await checkWorkersHeartbeat(mailer));
4821
4821
  }
4822
4822
  checks.push(await checkCircuitBreaker(mailer));
@@ -4881,13 +4881,14 @@ async function checkWorkersHeartbeat(mailer) {
4881
4881
  );
4882
4882
  const tickIntervalMs = mailer.config.tickIntervalSeconds * 1e3;
4883
4883
  const staleAfterMs = Math.max(tickIntervalMs * 3, 3e4);
4884
+ const workerless = mailer.config.workerless;
4884
4885
  if (!h) {
4885
4886
  return {
4886
4887
  name: "workers_heartbeat",
4887
4888
  label: "Background workers",
4888
4889
  severity: "warn",
4889
- message: "no tick has run yet",
4890
- hint: "If your separate worker process is started, the heartbeat will appear within one tick interval. If you forgot to run `mailer.startWorkers()`, sends will sit queued indefinitely."
4890
+ message: workerless ? "no tick has run yet (workers run in another process)" : "no tick has run yet",
4891
+ hint: workerless ? "This process is workerless; the heartbeat comes from your separate worker process. If that process is started, the heartbeat will appear within one tick interval \u2014 a fresh install legitimately has none yet." : "If your separate worker process is started, the heartbeat will appear within one tick interval. If you forgot to run `mailer.startWorkers()`, sends will sit queued indefinitely."
4891
4892
  };
4892
4893
  }
4893
4894
  const ageMs = Date.now() - new Date(h.updatedAt).getTime();
@@ -4897,14 +4898,14 @@ async function checkWorkersHeartbeat(mailer) {
4897
4898
  label: "Background workers",
4898
4899
  severity: "error",
4899
4900
  message: `last tick ${humanDuration(ageMs)} ago (expected within ${humanDuration(tickIntervalMs)})`,
4900
- hint: "Workers appear to be down. Sends and flow advancement are halted. Restart your worker process (`mailer.startWorkers()`)."
4901
+ hint: workerless ? "Workers run in another process, and that process appears to be down. Sends and flow advancement are halted. Restart the process that calls `mailer.startWorkers()`." : "Workers appear to be down. Sends and flow advancement are halted. Restart your worker process (`mailer.startWorkers()`)."
4901
4902
  };
4902
4903
  }
4903
4904
  return {
4904
4905
  name: "workers_heartbeat",
4905
4906
  label: "Background workers",
4906
4907
  severity: "ok",
4907
- message: `last tick ${humanDuration(ageMs)} ago`
4908
+ message: `last tick ${humanDuration(ageMs)} ago${workerless ? " (worker process)" : ""}`
4908
4909
  };
4909
4910
  }
4910
4911
  async function checkCircuitBreaker(mailer) {
@@ -7592,7 +7593,7 @@ var DEDUPE_POLICIES = [
7592
7593
  ];
7593
7594
 
7594
7595
  // src/server/index.ts
7595
- var VERSION = "0.10.1" ;
7596
+ var VERSION = "0.10.2" ;
7596
7597
 
7597
7598
  export { DEDUPE_POLICIES, FLOW_STEP_KINDS, Mailer, MongoContactAdapter, NullProvider, PREDICATE_KINDS, RESERVED_VAR_KEYS, SEGMENT_FILTER_KINDS, SendGridProvider, VERSION, applyTracking, applyWebhookEvent, compileMailyTemplate, compileTemplate, computeDeliveryTime, createAdminRouter, createPublicRouter, defaultFlowStep, defaultPredicate, defaultSegmentFilter, defineVars, derivePlaintext, dispatchSend, ensureIndexes, getCollections, predicateKind, processNewlyFiredEventTriggers, processOneRunStep, renderTemplate, runTick, sha256Hex, signUnsubscribeToken, sweepStrandedFlowRuns, validateSenderDomain, varsJsonSchema, verifyUnsubscribeToken };
7598
7599
  //# sourceMappingURL=index.js.map