Make the ping interval configurable

This commit is contained in:
Jonas Lochmann
2020-03-09 01:00:00 +01:00
parent 0ecb7e4830
commit 2ccdbfdd87
3 changed files with 10 additions and 4 deletions
+4 -2
View File
@@ -15,10 +15,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// note: soem configuration parameters are read directly at the location where they are used
// note: some configuration parameters are read directly at the location where they are used
interface Config {
mailWhitelist: Array<string>
disableSignup: boolean
pingInterval: number
}
function parseYesNo (value: string) {
@@ -33,5 +34,6 @@ function parseYesNo (value: string) {
export const config: Config = {
mailWhitelist: (process.env.MAIL_WHITELIST || '').split(',').map((item) => item.trim()).filter((item) => item.length > 0),
disableSignup: parseYesNo(process.env.DISABLE_SIGNUP || 'no')
disableSignup: parseYesNo(process.env.DISABLE_SIGNUP || 'no'),
pingInterval: parseInt(process.env.PING_INTERVAL_SEC || '25', 10) * 1000
}