mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
setting for database update threads
This commit is contained in:
@@ -56,7 +56,7 @@ public class FeedRefreshUpdater {
|
|||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
ApplicationSettings settings = applicationSettingsService.get();
|
ApplicationSettings settings = applicationSettingsService.get();
|
||||||
int threads = Math.max(settings.getBackgroundThreads(), 1);
|
int threads = Math.max(settings.getDatabaseUpdateThreads(), 1);
|
||||||
pool = new ThreadPoolExecutor(threads, threads, 0,
|
pool = new ThreadPoolExecutor(threads, threads, 0,
|
||||||
TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
|
TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
|
||||||
pool.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy() {
|
pool.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy() {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class ApplicationSettings extends AbstractModel {
|
|||||||
private String googleClientId;
|
private String googleClientId;
|
||||||
private String googleClientSecret;
|
private String googleClientSecret;
|
||||||
private int backgroundThreads = 3;
|
private int backgroundThreads = 3;
|
||||||
|
private int databaseUpdateThreads = 1;
|
||||||
private String smtpHost;
|
private String smtpHost;
|
||||||
private int smtpPort;
|
private int smtpPort;
|
||||||
private boolean smtpTls;
|
private boolean smtpTls;
|
||||||
@@ -153,4 +154,12 @@ public class ApplicationSettings extends AbstractModel {
|
|||||||
this.heavyLoad = heavyLoad;
|
this.heavyLoad = heavyLoad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getDatabaseUpdateThreads() {
|
||||||
|
return databaseUpdateThreads;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatabaseUpdateThreads(int databaseUpdateThreads) {
|
||||||
|
this.databaseUpdateThreads = databaseUpdateThreads;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="googleClientSecret">Background
|
<label class="control-label" for="googleClientSecret">Background HTTP
|
||||||
threads</label>
|
threads</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="number" name="backgroundThreads"
|
<input type="number" name="backgroundThreads"
|
||||||
@@ -68,6 +68,15 @@
|
|||||||
<span class="help-inline">Requires restart</span>
|
<span class="help-inline">Requires restart</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label" for="databaseUpdateThreads">Database update
|
||||||
|
threads</label>
|
||||||
|
<div class="controls">
|
||||||
|
<input type="number" name="databaseUpdateThreads"
|
||||||
|
ng-model="settings.databaseUpdateThreads" />
|
||||||
|
<span class="help-inline">Requires restart</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="announcement">Announcement</label>
|
<label class="control-label" for="announcement">Announcement</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|||||||
Reference in New Issue
Block a user