(projectId: string)
| 20 | process.env.QUEUE_CLUSTER ? `{${name}}` : name; |
| 21 | |
| 22 | function pickShard(projectId: string) { |
| 23 | const h = createHash('sha1').update(projectId).digest(); // 20 bytes |
| 24 | // take first 4 bytes as unsigned int |
| 25 | const x = h.readUInt32BE(0); |
| 26 | return x % EVENTS_GROUP_QUEUES_SHARDS; // 0..n-1 |
| 27 | } |
| 28 | |
| 29 | export const queueLogger = createLogger({ name: 'queue' }); |
| 30 |
no test coverage detected