MCPcopy Create free account
hub / github.com/Serverless-Devs/Serverless-Devs / updateComponent

Method updateComponent

src/command/custom/index.ts:103–114  ·  view source on GitHub ↗
(context: IContext)

Source from the content-addressed store, hash-verified

101 return join(reportComponentList, ',');
102 }
103 private async updateComponent(context: IContext) {
104 let executedComponent = filter(get(context, 'steps'), item => item.status === STEP_STATUS.SUCCESS);
105 executedComponent = uniqBy(executedComponent, item => item.component);
106 for (const item of executedComponent) {
107 const instance = await loadComponent(item.component, { logger });
108 const lockPath = utils.getLockFile(instance.__path);
109 const lockInfo = utils.readJson(lockPath);
110 if (!lockInfo.lastUpdateCheck || Date.now() - lockInfo.lastUpdateCheck > UPDATE_COMPONENT_CHECK_INTERVAL) {
111 execDaemon('update-component.js', { component: item.component });
112 }
113 }
114 }
115 // 当输出只有一条时,舍去key
116 private parseOutput(data: Object) {
117 if (keys(data).length === 1) return data[keys(data)[0]];

Callers 1

initMethod · 0.95

Calls 1

execDaemonFunction · 0.85

Tested by

no test coverage detected