Skip to content

Commit

Permalink
v2.3.0 - Update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
idanoo committed Sep 4, 2024
1 parent 5ef4a63 commit 2c995bd
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 114 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.3.0 (2024-09-04)
- Update packages

# 2.2.0 (2023-03-20)
- Update pacakges
- Bump requirements to PHP >= 8.1
Expand Down
131 changes: 66 additions & 65 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Resque/Job/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function create($id)
\Resque\Resque::redis()->set(
'job:' . $id . ':status',
json_encode($statusPacket),
['ex' => (86400 * 2)],
['ex' => \Resque\Redis::DEFAULT_REDIS_TTL],
);
}

Expand Down Expand Up @@ -106,7 +106,7 @@ public function update($status)
\Resque\Resque::redis()->set(
(string)$this,
json_encode($statusPacket),
['ex' => (86400 * 2)],
['ex' => \Resque\Redis::DEFAULT_REDIS_TTL],
);
}

Expand Down
8 changes: 8 additions & 0 deletions src/Resque/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ class Redis
{
/**
* Redis Client
*
* @var \Credis_Client
*/
private $driver;

/**
* Redis namespace
*
* @var string
*/
private static $defaultNamespace = 'resque:';
Expand All @@ -39,6 +41,11 @@ class Redis
*/
public const DEFAULT_DATABASE = 0;

/**
* Default Redis TTL (2 days)
*/
public const DEFAULT_REDIS_TTL = 172800;

/**
* @var array List of all commands in Redis that supply a key as their
* first argument. Used to prefix keys with the Resque namespace.
Expand Down Expand Up @@ -114,6 +121,7 @@ public static function prefix(string $namespace): void
if (substr($namespace, -1) !== ':' && $namespace != '') {
$namespace .= ':';
}

self::$defaultNamespace = $namespace;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Resque/Resque.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class Resque
{
public const VERSION = '2.1.0';
public const VERSION = '2.3.0';

public const DEFAULT_INTERVAL = 5;

Expand Down
2 changes: 1 addition & 1 deletion src/Resque/Stat.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function incr(string $stat, int $by = 1): bool
$set = Resque::redis()->set(
'stat:' . $stat,
$by,
['ex' => (86400 * 2), 'nx'],
['ex' => Redis::DEFAULT_REDIS_TTL, 'nx'],
);

// If it already exists, return the incrby value
Expand Down
Loading

0 comments on commit 2c995bd

Please sign in to comment.