@agendajs/redis-backend 2.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/RedisBackend.d.ts +7 -1
- package/dist/RedisBackend.js +13 -0
- package/dist/RedisBackend.js.map +1 -1
- package/dist/RedisJobLogger.d.ts +53 -0
- package/dist/RedisJobLogger.js +217 -0
- package/dist/RedisJobLogger.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -125,6 +125,43 @@ This means:
|
|
|
125
125
|
|
|
126
126
|
The backend uses Redis WATCH/MULTI/EXEC transactions to atomically lock jobs for processing, preventing duplicate execution across multiple Agenda instances.
|
|
127
127
|
|
|
128
|
+
## Job Logging
|
|
129
|
+
|
|
130
|
+
RedisBackend includes a built-in `RedisJobLogger` that stores structured job lifecycle events using Redis sorted sets and hashes. The logger is lightweight and only creates its keys on first use.
|
|
131
|
+
|
|
132
|
+
### Automatic Usage
|
|
133
|
+
|
|
134
|
+
When you enable logging in Agenda, the backend's built-in logger is used automatically:
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
const agenda = new Agenda({
|
|
138
|
+
backend: new RedisBackend({ connectionString: 'redis://localhost:6379' }),
|
|
139
|
+
logging: true // Uses RedisJobLogger automatically
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Standalone Usage
|
|
144
|
+
|
|
145
|
+
You can also use `RedisJobLogger` independently — for example, to log to Redis while using a different backend for storage:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
import { RedisJobLogger } from '@agendajs/redis-backend';
|
|
149
|
+
import Redis from 'ioredis';
|
|
150
|
+
|
|
151
|
+
const logger = new RedisJobLogger({
|
|
152
|
+
redis: new Redis('redis://localhost:6379')
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// Use with any backend
|
|
156
|
+
import { MongoBackend } from '@agendajs/mongo-backend';
|
|
157
|
+
const agenda = new Agenda({
|
|
158
|
+
backend: new MongoBackend({ mongo: db }),
|
|
159
|
+
logging: logger
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
See the [Agenda README](https://github.com/agenda/agenda#persistent-job-logging) for full logging documentation.
|
|
164
|
+
|
|
128
165
|
## Persistence
|
|
129
166
|
|
|
130
167
|
By default, Redis keeps data in memory. For production use with Agenda, configure Redis persistence:
|
package/dist/RedisBackend.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgendaBackend, JobRepository, NotificationChannel } from 'agenda';
|
|
1
|
+
import type { AgendaBackend, JobRepository, NotificationChannel, JobLogger } from 'agenda';
|
|
2
2
|
import type { RedisBackendConfig } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Redis backend for Agenda
|
|
@@ -41,6 +41,7 @@ export declare class RedisBackend implements AgendaBackend {
|
|
|
41
41
|
readonly name = "Redis";
|
|
42
42
|
private _repository;
|
|
43
43
|
private _notificationChannel;
|
|
44
|
+
private _logger;
|
|
44
45
|
private config;
|
|
45
46
|
private _ownsConnection;
|
|
46
47
|
constructor(config: RedisBackendConfig);
|
|
@@ -48,6 +49,11 @@ export declare class RedisBackend implements AgendaBackend {
|
|
|
48
49
|
* The job repository for storage operations
|
|
49
50
|
*/
|
|
50
51
|
get repository(): JobRepository;
|
|
52
|
+
/**
|
|
53
|
+
* The job logger for persistent event logging.
|
|
54
|
+
* Always available; Agenda decides whether to activate it via its `logging` config.
|
|
55
|
+
*/
|
|
56
|
+
get logger(): JobLogger;
|
|
51
57
|
/**
|
|
52
58
|
* The notification channel for real-time notifications via Pub/Sub
|
|
53
59
|
*/
|
package/dist/RedisBackend.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import debug from 'debug';
|
|
2
2
|
import { RedisJobRepository } from './RedisJobRepository.js';
|
|
3
|
+
import { RedisJobLogger } from './RedisJobLogger.js';
|
|
3
4
|
import { RedisNotificationChannel } from './RedisNotificationChannel.js';
|
|
4
5
|
const log = debug('agenda:redis:backend');
|
|
5
6
|
/**
|
|
@@ -43,6 +44,7 @@ export class RedisBackend {
|
|
|
43
44
|
name = 'Redis';
|
|
44
45
|
_repository;
|
|
45
46
|
_notificationChannel;
|
|
47
|
+
_logger;
|
|
46
48
|
config;
|
|
47
49
|
_ownsConnection;
|
|
48
50
|
constructor(config) {
|
|
@@ -58,6 +60,8 @@ export class RedisBackend {
|
|
|
58
60
|
enabled: true
|
|
59
61
|
}
|
|
60
62
|
});
|
|
63
|
+
// Always create the logger (lightweight; only initializes on first use when Agenda activates it)
|
|
64
|
+
this._logger = new RedisJobLogger({ keyPrefix: config.keyPrefix });
|
|
61
65
|
log('RedisBackend created with config: %O', {
|
|
62
66
|
keyPrefix: config.keyPrefix || 'agenda:',
|
|
63
67
|
channelName: config.channelName || 'agenda:jobs'
|
|
@@ -69,6 +73,13 @@ export class RedisBackend {
|
|
|
69
73
|
get repository() {
|
|
70
74
|
return this._repository;
|
|
71
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* The job logger for persistent event logging.
|
|
78
|
+
* Always available; Agenda decides whether to activate it via its `logging` config.
|
|
79
|
+
*/
|
|
80
|
+
get logger() {
|
|
81
|
+
return this._logger;
|
|
82
|
+
}
|
|
72
83
|
/**
|
|
73
84
|
* The notification channel for real-time notifications via Pub/Sub
|
|
74
85
|
*/
|
|
@@ -94,6 +105,8 @@ export class RedisBackend {
|
|
|
94
105
|
await this._repository.connect();
|
|
95
106
|
// Share the Redis client with notification channel
|
|
96
107
|
this._notificationChannel.setRedis(this._repository.getRedis());
|
|
108
|
+
// Initialize the job logger with the shared Redis client
|
|
109
|
+
this._logger.setRedis(this._repository.getRedis());
|
|
97
110
|
// Note: notification channel is connected by Agenda.start()
|
|
98
111
|
// when it's needed, so we don't connect it here
|
|
99
112
|
log('RedisBackend connected');
|
package/dist/Redis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AAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEnD,4DAA4D;QAC5D,gDAAgD;QAEhD,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU;QACf,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAElC,wDAAwD;QACxD,qDAAqD;QACrD,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;QAEpC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAClC,CAAC;CACD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Redis } from 'ioredis';
|
|
2
|
+
import type { JobLogger, JobLogEntry, JobLogQuery, JobLogQueryResult } from 'agenda';
|
|
3
|
+
/**
|
|
4
|
+
* Redis implementation of JobLogger.
|
|
5
|
+
* Stores job lifecycle events using Redis sorted sets and hashes.
|
|
6
|
+
*
|
|
7
|
+
* Data structure:
|
|
8
|
+
* - `{prefix}log:{id}` - Hash for each log entry
|
|
9
|
+
* - `{prefix}logs:all` - Sorted set of all log IDs (score = timestamp)
|
|
10
|
+
* - `{prefix}logs:by_job:{jobId}` - Sorted set of log IDs per job
|
|
11
|
+
* - `{prefix}logs:by_name:{jobName}` - Sorted set of log IDs per job name
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // Via backend (automatic connection sharing):
|
|
16
|
+
* import { RedisBackend } from '@agendajs/redis-backend';
|
|
17
|
+
*
|
|
18
|
+
* const backend = new RedisBackend({
|
|
19
|
+
* connectionString: 'redis://localhost:6379',
|
|
20
|
+
* logging: true // enables RedisJobLogger
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // Standalone (e.g., log to Redis while using Mongo for storage):
|
|
24
|
+
* import { RedisJobLogger } from '@agendajs/redis-backend';
|
|
25
|
+
* import Redis from 'ioredis';
|
|
26
|
+
*
|
|
27
|
+
* const logger = new RedisJobLogger({ redis: new Redis('redis://localhost:6379') });
|
|
28
|
+
* const agenda = new Agenda({
|
|
29
|
+
* backend: new MongoBackend({ address: 'mongodb://...' }),
|
|
30
|
+
* logging: logger
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class RedisJobLogger implements JobLogger {
|
|
35
|
+
private redis;
|
|
36
|
+
private readonly keyPrefix;
|
|
37
|
+
private idCounter;
|
|
38
|
+
constructor(options?: {
|
|
39
|
+
redis?: Redis;
|
|
40
|
+
keyPrefix?: string;
|
|
41
|
+
} | string);
|
|
42
|
+
private key;
|
|
43
|
+
/**
|
|
44
|
+
* Set the Redis client.
|
|
45
|
+
* Called by RedisBackend after the repository connects.
|
|
46
|
+
*/
|
|
47
|
+
setRedis(redis: Redis): void;
|
|
48
|
+
private generateId;
|
|
49
|
+
log(entry: Omit<JobLogEntry, '_id'>): Promise<void>;
|
|
50
|
+
getLogs(query?: JobLogQuery): Promise<JobLogQueryResult>;
|
|
51
|
+
clearLogs(query?: JobLogQuery): Promise<number>;
|
|
52
|
+
private hashToEntry;
|
|
53
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import debug from 'debug';
|
|
2
|
+
const log = debug('agenda:redis:logger');
|
|
3
|
+
/**
|
|
4
|
+
* Redis implementation of JobLogger.
|
|
5
|
+
* Stores job lifecycle events using Redis sorted sets and hashes.
|
|
6
|
+
*
|
|
7
|
+
* Data structure:
|
|
8
|
+
* - `{prefix}log:{id}` - Hash for each log entry
|
|
9
|
+
* - `{prefix}logs:all` - Sorted set of all log IDs (score = timestamp)
|
|
10
|
+
* - `{prefix}logs:by_job:{jobId}` - Sorted set of log IDs per job
|
|
11
|
+
* - `{prefix}logs:by_name:{jobName}` - Sorted set of log IDs per job name
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // Via backend (automatic connection sharing):
|
|
16
|
+
* import { RedisBackend } from '@agendajs/redis-backend';
|
|
17
|
+
*
|
|
18
|
+
* const backend = new RedisBackend({
|
|
19
|
+
* connectionString: 'redis://localhost:6379',
|
|
20
|
+
* logging: true // enables RedisJobLogger
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // Standalone (e.g., log to Redis while using Mongo for storage):
|
|
24
|
+
* import { RedisJobLogger } from '@agendajs/redis-backend';
|
|
25
|
+
* import Redis from 'ioredis';
|
|
26
|
+
*
|
|
27
|
+
* const logger = new RedisJobLogger({ redis: new Redis('redis://localhost:6379') });
|
|
28
|
+
* const agenda = new Agenda({
|
|
29
|
+
* backend: new MongoBackend({ address: 'mongodb://...' }),
|
|
30
|
+
* logging: logger
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export class RedisJobLogger {
|
|
35
|
+
redis;
|
|
36
|
+
keyPrefix;
|
|
37
|
+
idCounter = 0;
|
|
38
|
+
constructor(options) {
|
|
39
|
+
if (typeof options === 'string') {
|
|
40
|
+
// Legacy: constructor(keyPrefix)
|
|
41
|
+
this.keyPrefix = options;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.keyPrefix = options?.keyPrefix ?? 'agenda:';
|
|
45
|
+
if (options?.redis) {
|
|
46
|
+
this.redis = options.redis;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
key(suffix) {
|
|
51
|
+
return `${this.keyPrefix}${suffix}`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Set the Redis client.
|
|
55
|
+
* Called by RedisBackend after the repository connects.
|
|
56
|
+
*/
|
|
57
|
+
setRedis(redis) {
|
|
58
|
+
this.redis = redis;
|
|
59
|
+
log('Redis client set for job logger');
|
|
60
|
+
}
|
|
61
|
+
generateId() {
|
|
62
|
+
return `${Date.now()}-${process.pid}-${++this.idCounter}`;
|
|
63
|
+
}
|
|
64
|
+
async log(entry) {
|
|
65
|
+
if (!this.redis) {
|
|
66
|
+
log('redis not initialized, skipping log entry');
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const id = this.generateId();
|
|
70
|
+
const score = entry.timestamp.getTime();
|
|
71
|
+
const hashKey = this.key(`log:${id}`);
|
|
72
|
+
const hashData = {
|
|
73
|
+
id,
|
|
74
|
+
timestamp: entry.timestamp.toISOString(),
|
|
75
|
+
level: entry.level,
|
|
76
|
+
event: entry.event,
|
|
77
|
+
jobName: entry.jobName,
|
|
78
|
+
message: entry.message
|
|
79
|
+
};
|
|
80
|
+
if (entry.jobId)
|
|
81
|
+
hashData.jobId = entry.jobId;
|
|
82
|
+
if (entry.duration !== undefined)
|
|
83
|
+
hashData.duration = String(entry.duration);
|
|
84
|
+
if (entry.error)
|
|
85
|
+
hashData.error = entry.error;
|
|
86
|
+
if (entry.failCount !== undefined)
|
|
87
|
+
hashData.failCount = String(entry.failCount);
|
|
88
|
+
if (entry.retryDelay !== undefined)
|
|
89
|
+
hashData.retryDelay = String(entry.retryDelay);
|
|
90
|
+
if (entry.retryAttempt !== undefined)
|
|
91
|
+
hashData.retryAttempt = String(entry.retryAttempt);
|
|
92
|
+
if (entry.agendaName)
|
|
93
|
+
hashData.agendaName = entry.agendaName;
|
|
94
|
+
if (entry.meta)
|
|
95
|
+
hashData.meta = JSON.stringify(entry.meta);
|
|
96
|
+
const pipeline = this.redis.pipeline();
|
|
97
|
+
pipeline.hset(hashKey, hashData);
|
|
98
|
+
pipeline.zadd(this.key('logs:all'), score, id);
|
|
99
|
+
if (entry.jobId) {
|
|
100
|
+
pipeline.zadd(this.key(`logs:by_job:${entry.jobId}`), score, id);
|
|
101
|
+
}
|
|
102
|
+
pipeline.zadd(this.key(`logs:by_name:${entry.jobName}`), score, id);
|
|
103
|
+
await pipeline.exec();
|
|
104
|
+
}
|
|
105
|
+
async getLogs(query) {
|
|
106
|
+
if (!this.redis) {
|
|
107
|
+
return { entries: [], total: 0 };
|
|
108
|
+
}
|
|
109
|
+
// Determine which sorted set to query
|
|
110
|
+
let setKey;
|
|
111
|
+
if (query?.jobId) {
|
|
112
|
+
setKey = this.key(`logs:by_job:${query.jobId}`);
|
|
113
|
+
}
|
|
114
|
+
else if (query?.jobName) {
|
|
115
|
+
setKey = this.key(`logs:by_name:${query.jobName}`);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
setKey = this.key('logs:all');
|
|
119
|
+
}
|
|
120
|
+
// Build score range for timestamp filtering
|
|
121
|
+
const minScore = query?.from ? query.from.getTime() : '-inf';
|
|
122
|
+
const maxScore = query?.to ? query.to.getTime() : '+inf';
|
|
123
|
+
// Get all matching IDs (we'll filter in memory for level/event)
|
|
124
|
+
const sortOrder = query?.sort === 'asc' ? 'asc' : 'desc';
|
|
125
|
+
let allIds;
|
|
126
|
+
if (sortOrder === 'desc') {
|
|
127
|
+
allIds = await this.redis.zrevrangebyscore(setKey, maxScore, minScore);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
allIds = await this.redis.zrangebyscore(setKey, minScore, maxScore);
|
|
131
|
+
}
|
|
132
|
+
if (allIds.length === 0) {
|
|
133
|
+
return { entries: [], total: 0 };
|
|
134
|
+
}
|
|
135
|
+
// Fetch all hash data for these IDs
|
|
136
|
+
const pipeline = this.redis.pipeline();
|
|
137
|
+
for (const id of allIds) {
|
|
138
|
+
pipeline.hgetall(this.key(`log:${id}`));
|
|
139
|
+
}
|
|
140
|
+
const results = await pipeline.exec();
|
|
141
|
+
// Convert and filter
|
|
142
|
+
let entries = [];
|
|
143
|
+
if (results) {
|
|
144
|
+
for (const [err, data] of results) {
|
|
145
|
+
if (err || !data || typeof data !== 'object' || Object.keys(data).length === 0)
|
|
146
|
+
continue;
|
|
147
|
+
const hash = data;
|
|
148
|
+
const entry = this.hashToEntry(hash);
|
|
149
|
+
// Apply level filter
|
|
150
|
+
if (query?.level) {
|
|
151
|
+
const levels = Array.isArray(query.level) ? query.level : [query.level];
|
|
152
|
+
if (!levels.includes(entry.level))
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
// Apply event filter
|
|
156
|
+
if (query?.event) {
|
|
157
|
+
const events = Array.isArray(query.event) ? query.event : [query.event];
|
|
158
|
+
if (!events.includes(entry.event))
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
entries.push(entry);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const total = entries.length;
|
|
165
|
+
const offset = query?.offset ?? 0;
|
|
166
|
+
const limit = query?.limit ?? 50;
|
|
167
|
+
entries = entries.slice(offset, offset + limit);
|
|
168
|
+
return { entries, total };
|
|
169
|
+
}
|
|
170
|
+
async clearLogs(query) {
|
|
171
|
+
if (!this.redis) {
|
|
172
|
+
return 0;
|
|
173
|
+
}
|
|
174
|
+
// Get IDs to delete
|
|
175
|
+
const { entries, total } = await this.getLogs({
|
|
176
|
+
...query,
|
|
177
|
+
limit: Number.MAX_SAFE_INTEGER,
|
|
178
|
+
offset: 0
|
|
179
|
+
});
|
|
180
|
+
if (entries.length === 0)
|
|
181
|
+
return 0;
|
|
182
|
+
const pipeline = this.redis.pipeline();
|
|
183
|
+
for (const entry of entries) {
|
|
184
|
+
if (!entry._id)
|
|
185
|
+
continue;
|
|
186
|
+
// Remove hash
|
|
187
|
+
pipeline.del(this.key(`log:${entry._id}`));
|
|
188
|
+
// Remove from all sorted sets
|
|
189
|
+
pipeline.zrem(this.key('logs:all'), entry._id);
|
|
190
|
+
if (entry.jobId) {
|
|
191
|
+
pipeline.zrem(this.key(`logs:by_job:${entry.jobId}`), entry._id);
|
|
192
|
+
}
|
|
193
|
+
pipeline.zrem(this.key(`logs:by_name:${entry.jobName}`), entry._id);
|
|
194
|
+
}
|
|
195
|
+
await pipeline.exec();
|
|
196
|
+
return total;
|
|
197
|
+
}
|
|
198
|
+
hashToEntry(hash) {
|
|
199
|
+
return {
|
|
200
|
+
_id: hash.id,
|
|
201
|
+
timestamp: new Date(hash.timestamp),
|
|
202
|
+
level: hash.level,
|
|
203
|
+
event: hash.event,
|
|
204
|
+
jobId: hash.jobId || undefined,
|
|
205
|
+
jobName: hash.jobName,
|
|
206
|
+
message: hash.message,
|
|
207
|
+
duration: hash.duration ? parseInt(hash.duration, 10) : undefined,
|
|
208
|
+
error: hash.error || undefined,
|
|
209
|
+
failCount: hash.failCount ? parseInt(hash.failCount, 10) : undefined,
|
|
210
|
+
retryDelay: hash.retryDelay ? parseInt(hash.retryDelay, 10) : undefined,
|
|
211
|
+
retryAttempt: hash.retryAttempt ? parseInt(hash.retryAttempt, 10) : undefined,
|
|
212
|
+
agendaName: hash.agendaName || undefined,
|
|
213
|
+
meta: hash.meta ? JSON.parse(hash.meta) : undefined
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=RedisJobLogger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedisJobLogger.js","sourceRoot":"","sources":["../src/RedisJobLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,GAAG,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,OAAO,cAAc;IAClB,KAAK,CAAS;IACL,SAAS,CAAS;IAC3B,SAAS,GAAG,CAAC,CAAC;IAEtB,YAAY,OAAwD;QACnE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YACjC,iCAAiC;YACjC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;QAC1B,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,SAAS,CAAC;YACjD,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;gBACpB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC5B,CAAC;QACF,CAAC;IACF,CAAC;IAEO,GAAG,CAAC,MAAc;QACzB,OAAO,GAAG,IAAI,CAAC,SAAS,G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CAAC,CAAC,CAAC,CAAC,SAAS;YACvE,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;YAC7E,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,SAAS;YACxC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;SACnD,CAAC;IACH,CAAC;CACD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
export { RedisBackend } from './RedisBackend.js';
|
|
28
28
|
export { RedisJobRepository } from './RedisJobRepository.js';
|
|
29
|
+
export { RedisJobLogger } from './RedisJobLogger.js';
|
|
29
30
|
export { RedisNotificationChannel } from './RedisNotificationChannel.js';
|
|
30
31
|
export type { RedisBackendConfig, RedisJobData } from './types.js';
|
|
31
32
|
export type { RedisNotificationChannelConfig } from './RedisNotificationChannel.js';
|
package/dist/index.js
CHANGED
|
@@ -26,5 +26,6 @@
|
|
|
26
26
|
*/
|
|
27
27
|
export { RedisBackend } from './RedisBackend.js';
|
|
28
28
|
export { RedisJobRepository } from './RedisJobRepository.js';
|
|
29
|
+
export { RedisJobLogger } from './RedisJobLogger.js';
|
|
29
30
|
export { RedisNotificationChannel } from './RedisNotificationChannel.js';
|
|
30
31
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agendajs/redis-backend",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Redis backend for Agenda job scheduler with Pub/Sub notification support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"ioredis": "^5.4.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"agenda": "6.1
|
|
44
|
+
"agenda": "6.2.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/debug": "^4.1.12",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@vitest/coverage-v8": "^3.1.0",
|
|
50
50
|
"tsx": "^4.21.0",
|
|
51
51
|
"vitest": "^3.1.0",
|
|
52
|
-
"agenda": "6.1
|
|
52
|
+
"agenda": "6.2.1"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsc -b",
|