querysub 0.578.0 → 0.580.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "querysub",
3
- "version": "0.578.0",
3
+ "version": "0.580.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -71,7 +71,7 @@
71
71
  "node-forge": "https://github.com/sliftist/forge#e618181b469b07bdc70b968b0391beb8ef5fecd6",
72
72
  "pako": "^2.1.0",
73
73
  "peggy": "^5.0.6",
74
- "sliftutils": "^1.7.49",
74
+ "sliftutils": "^1.7.50",
75
75
  "socket-function": "^1.2.26",
76
76
  "terser": "^5.31.0",
77
77
  "typenode": "^6.6.1",
@@ -85,8 +85,8 @@ export class UpdateButtons extends qreact.Component<{
85
85
  let updated = deepCloneJSON(service);
86
86
  updated.parameters.gitRef = latestRef;
87
87
  updated.parameters.releaseTime = Date.now();
88
- // Always set, never inherited: the overlap belongs to the deploy being made, and leaving the previous deploy's value in place means one no-overlap deploy silently makes every later deploy a no-overlap one
89
- updated.parameters.overlapTime = noOverlap && 0 || DEFAULT_OVERLAP_TIME;
88
+ // Always set, never inherited: the overlap belongs to the deploy being made, and leaving the previous deploy's value in place means one no-overlap deploy silently makes every later deploy a no-overlap one. A ternary, as 0 is the value we actually want here and it is falsy.
89
+ updated.parameters.overlapTime = noOverlap ? 0 : DEFAULT_OVERLAP_TIME;
90
90
  return updated;
91
91
  });
92
92
  let controller = MachineServiceController(SocketFunction.browserNodeId());
@@ -203,8 +203,8 @@ export class UpdateServiceButtons extends qreact.Component<{
203
203
  let service = deepCloneJSON(this.props.service);
204
204
  service.parameters.gitRef = latestRef;
205
205
  service.parameters.releaseTime = Date.now();
206
- // Always set, never inherited - see deployAll
207
- service.parameters.overlapTime = noOverlap && 0 || DEFAULT_OVERLAP_TIME;
206
+ // Always set, never inherited - see deployAll. A ternary, as 0 is the value we actually want here and it is falsy.
207
+ service.parameters.overlapTime = noOverlap ? 0 : DEFAULT_OVERLAP_TIME;
208
208
  let controller = MachineServiceController(SocketFunction.browserNodeId());
209
209
  Querysub.onCommitFinished(async () => {
210
210
  try {
@@ -109,7 +109,7 @@ export type ServiceConfig = {
109
109
  };
110
110
  };
111
111
 
112
- export const DEFAULT_OVERLAP_TIME = timeInSecond * 60;
112
+ export const DEFAULT_OVERLAP_TIME = timeInSecond * 600;
113
113
 
114
114
  const TEMPLATE_VARIABLE_REGEX = /\$\{([a-zA-Z0-9_-]+)\}/g;
115
115
  /** The `${name}` placeholder names in a command template, in order of first appearance. */
@@ -28,7 +28,8 @@ export function getScreenName(config: { serviceKey: string; index: number }): st
28
28
  const RETIRING_MARKER = "-retiring-";
29
29
  /** A version being replaced is renamed to this, which frees the canonical name for its replacement at once. The name carries WHEN it is to be killed, so nothing has to remember: any pass that sees the screen can read its own deadline off it, and a restart loses nothing. */
30
30
  export function getRetiringScreenName(canonicalScreenName: string, killTime: number): string {
31
- return canonicalScreenName.slice(0, -SCREEN_SUFFIX.length) + RETIRING_MARKER + killTime + SCREEN_SUFFIX;
31
+ // Rounded because tmux reads a "." in a target as the window/pane separator, so a fractional time makes the name unkillable - it goes looking for a pane named after everything past the point
32
+ return canonicalScreenName.slice(0, -SCREEN_SUFFIX.length) + RETIRING_MARKER + Math.round(killTime) + SCREEN_SUFFIX;
32
33
  }
33
34
  /** When a retiring screen is due to be killed, or undefined when it is not a retiring screen at all. */
34
35
  export function getRetiringKillTime(screenName: string): number | undefined {