resolve circle dep
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const state = require('../infrastructure/state');
|
||||
const { removeDomain } = require('./core');
|
||||
const { removeVirtualInterface } = require('../networking/virtual_interfaces');
|
||||
// Lazy load removeVirtualInterface to avoid circular dependency
|
||||
let removeVirtualInterface = null;
|
||||
const { freePort } = require('../maintenance/cleanup');
|
||||
const { logDebug, logError, logInfo, logWarn } = require('../infrastructure/logger');
|
||||
const dgram = require('dgram');
|
||||
@@ -163,6 +164,10 @@ async function atomicDomainCleanup(domain) {
|
||||
if (state.domainToIPMap.has(domain)) {
|
||||
try {
|
||||
const ip = state.domainToIPMap.get(domain);
|
||||
// Lazy load removeVirtualInterface to avoid circular dependency
|
||||
if (!removeVirtualInterface) {
|
||||
removeVirtualInterface = require('../networking/virtual_interfaces').removeVirtualInterface;
|
||||
}
|
||||
await removeVirtualInterface(ip);
|
||||
state.domainToIPMap.delete(domain);
|
||||
logDebug('DomainCleanup', `Removed IP ${ip} for ${domain}`);
|
||||
|
||||
Reference in New Issue
Block a user