Merge pull request #259 from ruiwen/fix_redis

fix: allow redis details to be retrieved from environment variables
pull/285/head
Alexandre Dulaunoy 2019-01-03 09:34:53 +01:00 committed by GitHub
commit e6f4503763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -19,12 +19,14 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import redis
import hashlib
port = 6379
hostname = '127.0.0.1'
db = 5
port = int(os.getenv("REDIS_PORT")) if os.getenv("REDIS_PORT") else 6379
hostname = os.getenv("REDIS_BACKEND") or '127.0.0.1'
db = int(os.getenv("REDIS_DATABASE")) if os.getenv("REDIS_DATABASE") else 0
def selftest(enable=True):