Workaround: FIXME: as require_glob does not work, we need another way. This commit disables parallel-processing!
This commit is contained in:
		
							parent
							
								
									5674bf339c
								
							
						
					
					
						commit
						3b70a47502
					
				
							
								
								
									
										11
									
								
								daemon.py
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								daemon.py
									
									
									
									
									
								
							@ -109,13 +109,15 @@ def handleQuery(s, address, dmsg):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    log.info(f'{address[0]} |\tNOTIFY for {name}')
 | 
					    log.info(f'{address[0]} |\tNOTIFY for {name}')
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    _thread.start_new_thread(updateNsData, (name,))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    response = dmsg.reply() # type: dns.message.Message
 | 
					    response = dmsg.reply() # type: dns.message.Message
 | 
				
			||||||
    response.header.aa = 1
 | 
					    response.header.aa = 1
 | 
				
			||||||
    sendResponse(s, address, response)
 | 
					    sendResponse(s, address, response)
 | 
				
			||||||
    log.debug(f'{address[0]} |\tSent response')
 | 
					    log.debug(f'{address[0]} |\tSent response')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # FIXME: see: data/dnsconfig.js require_glob
 | 
				
			||||||
 | 
					    #_thread.start_new_thread(updateNsData, (name,))
 | 
				
			||||||
 | 
					    updateNsData(name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return True
 | 
					    return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def makeResponseWithRCode(socket, address, dmsg, rcode):
 | 
					def makeResponseWithRCode(socket, address, dmsg, rcode):
 | 
				
			||||||
@ -156,7 +158,10 @@ def updateNsData(zone):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        log.info(f'{adaptedZone} |\tUpdating NS-Data')
 | 
					        log.info(f'{adaptedZone} |\tUpdating NS-Data')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        dumpFile = f"{adaptedZone}.dump.js"
 | 
					        # FIXME: see: data/dnsconfig.js require_glob
 | 
				
			||||||
 | 
					        #dumpFile = f"{adaptedZone}.dump.js"
 | 
				
			||||||
 | 
					        dumpFile = "dump.js"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if dumpZoneData(zone, dumpFile) != 0:
 | 
					        if dumpZoneData(zone, dumpFile) != 0:
 | 
				
			||||||
            raise Exception("Dumping data failed!")
 | 
					            raise Exception("Dumping data failed!")
 | 
				
			||||||
        zone = adaptedZone
 | 
					        zone = adaptedZone
 | 
				
			||||||
 | 
				
			|||||||
@ -20,4 +20,8 @@ D('example.com', REG_NONE, DnsProvider(cloudflare));
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Include
 | 
					// Include
 | 
				
			||||||
//  (Do not touch unless you know what you are doing!)
 | 
					//  (Do not touch unless you know what you are doing!)
 | 
				
			||||||
require_glob("/app/hosts/");
 | 
					
 | 
				
			||||||
 | 
					// FIXME: As require_glob does not work, we have to find another way to allow multiple files being loaded into dnscontrol
 | 
				
			||||||
 | 
					//         Maybe load 1 seperate file which can be expanded (being careful about thread-safety)
 | 
				
			||||||
 | 
					//require_glob("/app/hosts/");
 | 
				
			||||||
 | 
					require("/app/hosts/dump.js");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user