Revision 46718
Added by Claudio Atzori about 7 years ago
DatasourceInfoRetriever.java | ||
---|---|---|
17 | 17 |
import org.apache.commons.logging.Log; |
18 | 18 |
import org.apache.commons.logging.LogFactory; |
19 | 19 |
import org.springframework.beans.factory.annotation.Autowired; |
20 |
import org.springframework.beans.factory.annotation.Value; |
|
20 | 21 |
|
21 | 22 |
/** |
22 | 23 |
* Created by claudio on 20/10/2016. |
... | ... | |
41 | 42 |
|
42 | 43 |
private final static int WORKERS = 100; |
43 | 44 |
|
45 |
@Value("${datasource.publisher.timeout}") |
|
46 |
private int timeout = 10; |
|
47 |
|
|
44 | 48 |
public DatasourceInfoRetriever() { |
45 | 49 |
service = MoreExecutors.listeningDecorator( |
46 | 50 |
new ScheduledThreadPoolExecutor(WORKERS, |
... | ... | |
98 | 102 |
innerLatch.countDown(); |
99 | 103 |
} |
100 | 104 |
}); |
101 |
waitLatch(innerLatch, errors, 10);
|
|
105 |
waitLatch(innerLatch, errors, timeout);
|
|
102 | 106 |
|
103 | 107 |
outerLatch.countDown(); |
104 | 108 |
} |
... | ... | |
109 | 113 |
} |
110 | 114 |
}); |
111 | 115 |
|
112 |
waitLatch(outerLatch, errors, 10);
|
|
116 |
waitLatch(outerLatch, errors, timeout);
|
|
113 | 117 |
|
114 | 118 |
if (!errors.isEmpty()) { |
115 | 119 |
datasourceResponse.getResponseHeader().setError(Joiner.on("\n").skipNulls().join(Iterables.transform(errors, new Function<Throwable, String>() { |
Also available in: Unified diff
integrated most recent changes from dnet40