Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #3576] [Enhancement] Adding the destroy lifecycle method on NamingMaintainService #3985

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,10 @@ void updateService(String serviceName, String groupName, float protectThreshold,
*/
void updateService(Service service, AbstractSelector selector) throws NacosException;

/**
* Shutdown the resource service.
*
* @throws NacosException exception.
*/
void shutDown() throws NacosException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,8 @@ public void updateService(Service service, AbstractSelector selector) throws Nac
serverProxy.updateService(service, selector);
}

@Override
public void shutDown() throws NacosException {
serverProxy.shutdown();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.alibaba.nacos.api.selector.NoneSelector;
import com.alibaba.nacos.sys.utils.ApplicationUtils;
import com.alibaba.nacos.test.BaseTest;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -163,5 +164,10 @@ public void deleteService() throws NacosException {

Assert.assertTrue(namingMaintainService.deleteService(serviceName));
}


@After
public void tearDown() throws NacosException {
namingMaintainService.shutDown();
namingService.shutDown();
}
}