mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-10-29 23:35:02 -04:00 
			
		
		
		
	Added option to auto-clean NPM cache on update. #3225
This commit is contained in:
		
							parent
							
								
									04876bf823
								
							
						
					
					
						commit
						0b38049015
					
				
							
								
								
									
										
											BIN
										
									
								
								agents/MeshCentralRouterCmd.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								agents/MeshCentralRouterCmd.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -97,6 +97,7 @@ | ||||
|         "webRTC": { "type": "boolean", "default": false, "description": "When enabled, allows use of WebRTC to allow direct network traffic between the agent and browser." }, | ||||
|         "nice404": { "type": "boolean", "default": true, "description": "By default, a nice looking 404 error page is displayed when needed. Set this to false to disable it." }, | ||||
|         "selfUpdate": { "type": "boolean", "default": false, "description": "When true, this server will attempt to self-update everyday after midnight." }, | ||||
|         "cleanNpmCacheOnUpdate": { "type": "boolean", "default": false, "description": "When true, run \"npm cache clean --force\" to reclame disk space." }, | ||||
|         "browserPing": { "type": "integer", "minimum": 1, "description": "When specified, sends data to the browser at x seconds interval and expects a response from the browser." }, | ||||
|         "browserPong": { "type": "integer", "minimum": 1, "description": "When specified, sends data to the browser at x seconds interval." }, | ||||
|         "agentsInRam": { "type": "boolean", "default": false, "description": "Loads all agent binaries in RAM for faster agent updates." }, | ||||
|  | ||||
| @ -467,7 +467,15 @@ function CreateMeshCentralServer(config, args) { | ||||
|                 xxprocess.stderr.on('data', function (data) { xxprocess.data += data; }); | ||||
|                 xxprocess.on('close', function (code) { | ||||
|                     if (code == 0) { console.log('Update completed...'); } | ||||
|                     setTimeout(function () { obj.launchChildServer(startArgs); }, 1000); | ||||
|                     if (obj.args.cleannpmcacheonupdate === true) { | ||||
|                         // Perform NPM cache clean
 | ||||
|                         console.log('Cleaning NPM cache...'); | ||||
|                         var xxxprocess = child_process.exec(npmpath + ' cache clean --force', { maxBuffer: Infinity, cwd: obj.parentpath, env: env }, function (error, stdout, stderr) { }); | ||||
|                         xxxprocess.on('close', function (code) { setTimeout(function () { obj.launchChildServer(startArgs); }, 1000); }); | ||||
|                     } else { | ||||
|                         // Run the updated server
 | ||||
|                         setTimeout(function () { obj.launchChildServer(startArgs); }, 1000); | ||||
|                     } | ||||
|                 }); | ||||
|             } else { | ||||
|                 if (error != null) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user