Turns out I'd completely forgotten what an absolute shit PHP is when it comes to serialising as json. json_encode() will serialise to an object - you can tell json_decode() to deserialise to an array, but if there are objects within that array they'll become arrays again.
// Redis config
public $redis_enabled = true;
public $redis_host = 'myhost';
public $redis_port = 6379;
// Set this to your redis password if enabled
public $redis_pass = false;
// Number of seconds an item in redis is valid for
public $redis_ttl = 300;
Currently the application will die if it can't reach redis - we might want to make it more graceful than that in future, but dying early is useful for testing
This commit adds new config options and then puts redis calls into callAPI() so that we don't need to make repeated calls out to Gitlab for things that are requested regularly
Activity
21-Oct-21 22:54
assigned to @btasker
21-Apr-22 07:35
mentioned in issue #30
21-Apr-22 16:46
Standing up a simple Redis server to test against
21-Apr-22 17:01
Turns out I'd completely forgotten what an absolute shit PHP is when it comes to serialising as json.
json_encode()
will serialise to an object - you can telljson_decode()
to deserialise to an array, but if there are objects within that array they'll become arrays again.The answer, of course, is to use
serialize()
21-Apr-22 17:12
I've added some config options:
Currently the application will die if it can't reach redis - we might want to make it more graceful than that in future, but dying early is useful for testing
21-Apr-22 17:13
mentioned in commit da1bd070591b0651f2a000435509fbd6c9a3834f
Message
Install and enable the Redis PHP library when building the image (see websites/Gitlab-Issue-Listing-Script#16 )
21-Apr-22 17:14
mentioned in commit ad87ed468811b35e42a748e3bfaa6bbbab977517
Message
Add support for Redis as a caching layer for websites/Gitlab-Issue-Listing-Script#16
This commit adds new config options and then puts redis calls into
callAPI()
so that we don't need to make repeated calls out to Gitlab for things that are requested regularly21-Apr-22 17:19
mentioned in commit 936d24126673b065cb817ab8c918d0aaa57c6f1e
Message
Handle an unusable Redis more gracefully for websites/Gitlab-Issue-Listing-Script#16