forked from SWI-Prolog/swish
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document Redis plugin and allow overruling the use of redis by the IDE.
- Loading branch information
1 parent
3b72972
commit 854219b
Showing
2 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,58 @@ | ||
/* Part of SWISH | ||
Author: Jan Wielemaker | ||
E-mail: [email protected] | ||
WWW: http://www.swi-prolog.org | ||
Copyright (C): 2020, SWI-Prolog Solutions b.v. | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
1. Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in | ||
the documentation and/or other materials provided with the | ||
distribution. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
:- module(config_redis, []). | ||
|
||
/** <module> Configure Redis | ||
SWISH may be configured to use the Redis key-value store for the various | ||
databases. This allows multiple SWISH instances to act as a cluster. | ||
Typically the configuration needs to be edited in two places: | ||
- redis_server/3 must be called to address the Redis server | ||
- redis_consumer may be set to identify this instance. The | ||
default is derived from the host name and port to which | ||
this SWISH instance listens. Clusters are advised to | ||
assign a stable name to each cluster member. | ||
*/ | ||
|
||
:- multifile swish_config:config/2. | ||
|
||
% Do not activate if `config(redis,false)` is present | ||
:- if(\+swish_config:config(ide,true)). | ||
|
||
:- use_module(swish(lib/config), []). | ||
:- use_module(library(redis)). | ||
:- use_module(library(settings)). | ||
|
@@ -9,10 +63,9 @@ | |
|
||
:- redis_server(swish, localhost:6379, []). | ||
|
||
:- multifile swish_config:config/2. | ||
swish_config:config(redis, swish). | ||
swish_config:config(redis_prefix, swish). | ||
%swish_config:config(redis_consumer, alice). | ||
%swish_config:config(redis_consumer, peter). | ||
|
||
:- set_setting(user_profile:redis_server, swish). | ||
:- set_setting(user_profile:redis_prefix, 'swish:profiles'). | ||
|
@@ -22,3 +75,5 @@ | |
:- http_set_session_options([ redis_db(swish), | ||
redis_prefix('swish:http:session') | ||
]). | ||
|
||
:- endif. % \+swish_config:config(ide,true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters