mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
admin setting for background thread count
This commit is contained in:
@@ -23,7 +23,6 @@ import com.commafeed.backend.model.FeedCategory;
|
|||||||
import com.commafeed.backend.model.FeedSubscription;
|
import com.commafeed.backend.model.FeedSubscription;
|
||||||
import com.commafeed.backend.model.User;
|
import com.commafeed.backend.model.User;
|
||||||
import com.commafeed.backend.model.UserRole.Role;
|
import com.commafeed.backend.model.UserRole.Role;
|
||||||
import com.commafeed.backend.services.PasswordEncryptionService;
|
|
||||||
import com.commafeed.backend.services.UserService;
|
import com.commafeed.backend.services.UserService;
|
||||||
|
|
||||||
@Startup
|
@Startup
|
||||||
@@ -48,9 +47,6 @@ public class StartupBean {
|
|||||||
@Inject
|
@Inject
|
||||||
UserService userService;
|
UserService userService;
|
||||||
|
|
||||||
@Inject
|
|
||||||
PasswordEncryptionService encryptionService;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ApplicationSettingsDAO applicationSettingsDAO;
|
ApplicationSettingsDAO applicationSettingsDAO;
|
||||||
|
|
||||||
@@ -66,8 +62,8 @@ public class StartupBean {
|
|||||||
initialData();
|
initialData();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3 threads
|
ApplicationSettings settings = applicationSettingsDAO.get();
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < settings.getBackgroundThreads(); i++) {
|
||||||
worker.start();
|
worker.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public class ApplicationSettings extends AbstractModel {
|
|||||||
private boolean allowRegistrations = false;
|
private boolean allowRegistrations = false;
|
||||||
private String googleClientId;
|
private String googleClientId;
|
||||||
private String googleClientSecret;
|
private String googleClientSecret;
|
||||||
|
private int backgroundThreads = 3;
|
||||||
|
|
||||||
public String getPublicUrl() {
|
public String getPublicUrl() {
|
||||||
return publicUrl;
|
return publicUrl;
|
||||||
@@ -45,4 +46,12 @@ public class ApplicationSettings extends AbstractModel {
|
|||||||
this.googleClientSecret = googleClientSecret;
|
this.googleClientSecret = googleClientSecret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getBackgroundThreads() {
|
||||||
|
return backgroundThreads;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackgroundThreads(int backgroundThreads) {
|
||||||
|
this.backgroundThreads = backgroundThreads;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<form name="settingsForm" class="form-horizontal" ng-submit="save()">
|
<form name="settingsForm" class="form-horizontal" ng-submit="save()">
|
||||||
|
<!-- not needed atm
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="publicUrl">Public URL</label>
|
<label class="control-label" for="publicUrl">Public URL</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
ng-model="settings.publicUrl" />
|
ng-model="settings.publicUrl" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="allowRegistrations">Allow
|
<label class="control-label" for="allowRegistrations">Allow
|
||||||
registrations</label>
|
registrations</label>
|
||||||
@@ -41,6 +43,16 @@
|
|||||||
ng-model="settings.googleClientSecret" />
|
ng-model="settings.googleClientSecret" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label" for="googleClientSecret">Background
|
||||||
|
threads</label>
|
||||||
|
<div class="controls">
|
||||||
|
<input type="number" name="backgroundThreads"
|
||||||
|
ng-model="settings.backgroundThreads" />
|
||||||
|
<span class="help-inline">Requires restart</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<button type="button" class="btn" ng-click="cancel()">Cancel</button>
|
<button type="button" class="btn" ng-click="cancel()">Cancel</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user