mirror of
				https://github.com/ThomasGsp/HyperProxmox.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	Insert lock system for mod analyst
This commit is contained in:
		
							parent
							
								
									a1b0609332
								
							
						
					
					
						commit
						c335afc350
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		|  | @ -11,6 +11,7 @@ to allocate news instances. | |||
| from core.modules.mod_proxmox import * | ||||
| from core.modules.mod_database import * | ||||
| from core.libs.hcrypt import * | ||||
| from core.libs.locker import * | ||||
| import time | ||||
| import operator | ||||
| import random | ||||
|  | @ -53,6 +54,10 @@ class Analyse: | |||
|     def run(self, instancetype="all"): | ||||
|         insert_time = time.time() | ||||
| 
 | ||||
|         """ Create lock file """ | ||||
|         locker = Locker() | ||||
|         locker.createlock(self.generalconf["hyperproxmox"]["walker_lock"], insert_time) | ||||
| 
 | ||||
|         self.mongo.insert_datekey(insert_time, 'running') | ||||
| 
 | ||||
|         for cluster in self.clusters_conf: | ||||
|  | @ -142,6 +147,10 @@ class Analyse: | |||
|                 print(nodes_list) | ||||
| 
 | ||||
|         self.mongo.update_datekey(int(insert_time), "OK") | ||||
| 
 | ||||
|         """ Unlock file """ | ||||
|         locker.unlock(self.generalconf["hyperproxmox"]["walker_lock"]) | ||||
| 
 | ||||
|         return | ||||
| 
 | ||||
|     def set_attribution(self, count): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue