Skip to content

Commit

Permalink
Merge pull request #165 from zjcscut/main
Browse files Browse the repository at this point in the history
support springboot 3.x
  • Loading branch information
stelin committed Feb 24, 2024
2 parents f824210 + 4d0f99c commit eab6210
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import io.openjob.worker.delay.OpenjobDelayTemplate;
import io.openjob.worker.spring.boot.OpenjobSpringWorker;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import java.util.Objects;

/**
Expand All @@ -22,19 +22,17 @@
*/
@Configuration
@EnableConfigurationProperties(value = {OpenjobWorkerProperties.class})
public class OpenjobWorkerAutoConfiguration {
public class OpenjobWorkerAutoConfiguration implements InitializingBean {

private final OpenjobWorkerProperties properties;

@Autowired
public OpenjobWorkerAutoConfiguration(OpenjobWorkerProperties properties) {
this.properties = properties;
}

/**
* Init
*/
@PostConstruct
public void init() {
@Override
public void afterPropertiesSet() throws Exception {
// Server address
if (StringUtils.isEmpty(System.getProperty(WorkerConstant.SERVER_ADDRESS))
&& Objects.nonNull(this.properties.getServer().getAddress())) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.openjob.worker.spring.boot.autoconfigure.OpenjobWorkerAutoConfiguration

0 comments on commit eab6210

Please sign in to comment.