1 | <?php |
||
12 | class CleanupExpiredTokensCronTask implements CronTask |
||
13 | { |
||
14 | use Configurable; |
||
15 | |||
16 | /** |
||
17 | * Number of days to delete expired tokens. |
||
18 | * |
||
19 | * @var int |
||
20 | */ |
||
21 | private static $age = 7; |
||
22 | |||
23 | /** |
||
24 | * Run at 1am every day. |
||
25 | * |
||
26 | * @return string |
||
27 | */ |
||
28 | public function getSchedule() |
||
32 | |||
33 | /** |
||
34 | * Delete tokens which have expired more than $age days. |
||
35 | */ |
||
36 | public function process() |
||
40 | |||
41 | /** |
||
42 | * Get the repository for managing access tokens. |
||
43 | * |
||
44 | * @return AccessTokenRepository |
||
45 | */ |
||
46 | protected function getTokenRepository(): AccessTokenRepository |
||
50 | } |
||
51 |