Skip to content

Commit

Permalink
Merge branch 'main' of github.com:open-job/openjob into 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
stelin committed Feb 24, 2024
2 parents 24b0733 + eab6210 commit a30602d
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 a30602d

Please sign in to comment.