MCPcopy Create free account
hub / github.com/ShipSecAI/studio / ensureNamespace

Method ensureNamespace

backend/src/temporal/temporal.service.ts:268–289  ·  view source on GitHub ↗
(connection: Connection)

Source from the content-addressed store, hash-verified

266 }
267
268 private async ensureNamespace(connection: Connection): Promise<void> {
269 try {
270 await connection.workflowService.describeNamespace({
271 namespace: this.namespace,
272 });
273 } catch (error) {
274 if (!this.isNotFoundError(error)) {
275 this.logger.error(
276 `Failed to describe Temporal namespace ${this.namespace}: ${
277 error instanceof Error ? error.message : String(error)
278 }`,
279 );
280 throw error;
281 }
282
283 this.logger.log(`Registering Temporal namespace ${this.namespace}`);
284 await connection.workflowService.registerNamespace({
285 namespace: this.namespace,
286 workflowExecutionRetentionPeriod: { seconds: Long.fromNumber(60 * 60 * 24 * 7) },
287 });
288 }
289 }
290
291 private isNotFoundError(error: unknown): error is ServiceError {
292 if (!error || typeof error !== 'object') {

Callers 1

getClientMethod · 0.95

Calls 2

isNotFoundErrorMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected