Skip to content

Commit bcffed7

Browse files
committed
github: revert back to file cache since the DB is overloaded
1 parent fa8ea41 commit bcffed7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cron.php

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ function get_courses() {
9797

9898
function run_prune_cache() {
9999
db_delete_cache();
100+
`rm -fr .cache`;
100101
}
101102

102103
// Update student's group information

github.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Http\Discovery\Psr18ClientDiscovery;
1313
use Psr\Http\Message\RequestInterface;
1414
use Psr\Http\Message\ResponseInterface;
15-
use Symfony\Component\Cache\Adapter\PdoAdapter;
15+
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
1616

1717
class MyJournal implements \Http\Client\Common\Plugin\Journal {
1818
public function addSuccess(RequestInterface $request,
@@ -65,7 +65,8 @@ public function clearHeaders(): void {
6565
public function getHttpClient(): HttpMethodsClientInterface {
6666
if (!$this->client) {
6767
$stream = Psr17FactoryDiscovery::findStreamFactory();
68-
$pool = new PdoAdapter(DB_DSN, 'cache', $this->timeout);
68+
//$pool = new PdoAdapter(DB_DSN, 'cache', $this->timeout);
69+
$pool = new FilesystemAdapter('github', $this->timeout, '.cache');
6970
$config = ['respect_response_cache_directives' => [],
7071
'default_ttl' => $this->timeout];
7172
$plugins = $this->plugins;

0 commit comments

Comments
 (0)