We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
This is how I use it now
try(GitLabApi gitLabApi = new GitLabApi(rootUrl, param.getGitlabToken())) { MergeRequestParams mrParams = new MergeRequestParams() .withSourceBranch(param.getSourceBranch()) .withTargetBranch(param.getTargetBranch()) .withTitle(param.getTitle()) .withDescription(param.getDescription()) .withLabels(param.getLabels()); MergeRequest mergeRequest = gitLabApi.getMergeRequestApi().createMergeRequest(param.getGitProjectId().longValue(), mrParams); return GitlabFormatUtils.buildGitlabMergeRequest(mergeRequest); } catch (GitLabApiException e) { log.error("创建MergeRequest失败,param:{}", param, e); throw new ServiceException("创建gitlab MergeRequest失败"); }
I want to change it to the following, but I am worried about thread safety issues
@Configuration public class GitLabSdkConfig { @Value("${gitlab.rootUrl}") private String rootUrl; @Value("${gitlab.devopsToken}") private String devopsToken; @Bean public GitLabApi initGitLabApi() { return new GitLabApi(rootUrl, devopsToken); } }
@Resource private GitLabApi gitLabApi; try { MergeRequestParams mrParams = new MergeRequestParams() .withSourceBranch(param.getSourceBranch()) .withTargetBranch(param.getTargetBranch()) .withTitle(param.getTitle()) .withDescription(param.getDescription()) .withLabels(param.getLabels()); MergeRequest mergeRequest = gitLabApi.getMergeRequestApi().createMergeRequest(param.getGitProjectId().longValue(), mrParams); return GitlabFormatUtils.buildGitlabMergeRequest(mergeRequest); } catch (GitLabApiException e) { log.error("创建MergeRequest失败,param:{}", param, e); throw new ServiceException("创建gitlab MergeRequest失败"); }
thanks for your answer
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This is how I use it now
I want to change it to the following, but I am worried about thread safety issues
thanks for your answer
The text was updated successfully, but these errors were encountered: