forked from Forceu/barcodebuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cron.php
35 lines (28 loc) · 849 Bytes
/
cron.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* Barcode Buddy for Grocy
*
* PHP version 7
*
* LICENSE: This source file is subject to version 3.0 of the GNU General
* Public License v3.0 that is attached to this project.
*
* @author Marc Ole Bulling
* @copyright 2020 Marc Ole Bulling
* @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU GPL v3.0
* @since File available since Release 1.6
*
* Cron file to update cache
*/
require_once __DIR__ . "/incl/config.inc.php";
require_once __DIR__ . "/incl/redis.inc.php";
$config = BBConfig::getInstance();
if ($config["GROCY_API_URL"] == null || $config["GROCY_API_KEY"] == null)
die();
if ($config["USE_REDIS"]) {
$softUpdate = (!isset($_GET["force"]));
RedisConnection::updateCache($softUpdate);
}
BarcodeFederation::doScheduledSyncBarcodes();
if (isset($_GET["ajax"]))
echo "OK";