@infernetprotocol/cli 0.1.39 → 0.1.41
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/commands/inference.js +28 -5
- package/commands/register.js +25 -11
- package/lib/inference/petals-client.py.js +17 -0
- package/package.json +6 -6
- package/examples/app.js +0 -153
- package/lib/runtime-config.js +0 -130
package/commands/inference.js
CHANGED
|
@@ -127,13 +127,36 @@ async function cmdServe(args) {
|
|
|
127
127
|
prefix,
|
|
128
128
|
num_blocks: numBlocks,
|
|
129
129
|
pid: child.pid,
|
|
130
|
-
started_at: new Date().toISOString()
|
|
130
|
+
started_at: new Date().toISOString(),
|
|
131
|
+
peer_id: null
|
|
131
132
|
});
|
|
132
133
|
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
// Watch Petals' startup logs for the peer ID line — looks like
|
|
135
|
+
// "This server's peer ID: 12D3KooW..." (libp2p Ed25519). We
|
|
136
|
+
// capture it so `infernet register` can advertise it; the
|
|
137
|
+
// control plane needs the mapping to attribute per-layer CPR
|
|
138
|
+
// receipts to layer-contributing operators.
|
|
139
|
+
const tapForPeerId = (stream, sink) => {
|
|
140
|
+
let buf = "";
|
|
141
|
+
stream.on("data", async (chunk) => {
|
|
142
|
+
const txt = chunk.toString();
|
|
143
|
+
sink.write(txt);
|
|
144
|
+
buf += txt;
|
|
145
|
+
const m = buf.match(/peer ID[:\s]+([1-9A-HJ-NP-Za-km-z]{40,80})/i);
|
|
146
|
+
if (m) {
|
|
147
|
+
const state = (await readState()) ?? {};
|
|
148
|
+
if (!state.peer_id) {
|
|
149
|
+
state.peer_id = m[1];
|
|
150
|
+
await writeState(state);
|
|
151
|
+
process.stdout.write(`[infernet] captured petals peer id: ${m[1]}\n`);
|
|
152
|
+
}
|
|
153
|
+
buf = "";
|
|
154
|
+
}
|
|
155
|
+
if (buf.length > 4096) buf = buf.slice(-2048);
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
if (child.stdout) tapForPeerId(child.stdout, process.stdout);
|
|
159
|
+
if (child.stderr) tapForPeerId(child.stderr, process.stderr);
|
|
137
160
|
|
|
138
161
|
process.stdout.write(
|
|
139
162
|
`\n✓ Petals server pid=${child.pid} started.\n` +
|
package/commands/register.js
CHANGED
|
@@ -208,27 +208,41 @@ export async function gatherCoarseSpecs() {
|
|
|
208
208
|
// IPIP-0031: models this node is contributing to a Petals swarm.
|
|
209
209
|
// Empty array if the operator hasn't run `infernet inference serve`.
|
|
210
210
|
// Read from local state file written by inference.js.
|
|
211
|
-
petals_models: await readPetalsModels()
|
|
211
|
+
petals_models: await readPetalsModels(),
|
|
212
|
+
// IPIP-0031 §per-layer-attribution: libp2p peer ID Petals
|
|
213
|
+
// assigned this server. The control plane uses this to map
|
|
214
|
+
// chosen_servers from a client's routing event back to the
|
|
215
|
+
// corresponding provider rows for CPR receipt distribution.
|
|
216
|
+
petals_peer_id: await readPetalsPeerId()
|
|
212
217
|
};
|
|
213
218
|
}
|
|
214
219
|
|
|
215
220
|
async function readPetalsModels() {
|
|
221
|
+
const state = await readPetalsState();
|
|
222
|
+
if (!state) return [];
|
|
223
|
+
if (state.backend === 'petals' && typeof state.model === 'string') {
|
|
224
|
+
return [state.model];
|
|
225
|
+
}
|
|
226
|
+
return [];
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
async function readPetalsPeerId() {
|
|
230
|
+
const state = await readPetalsState();
|
|
231
|
+
return (state && typeof state.peer_id === 'string') ? state.peer_id : null;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
async function readPetalsState() {
|
|
216
235
|
try {
|
|
217
236
|
const fsp = await import('node:fs/promises');
|
|
218
237
|
const path = await import('node:path');
|
|
219
238
|
const statePath = path.join(process.env.HOME ?? '/tmp', '.infernet', 'inference', 'state.json');
|
|
220
239
|
const raw = await fsp.readFile(statePath, 'utf8');
|
|
221
240
|
const state = JSON.parse(raw);
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
if (state.backend === 'petals' && typeof state.model === 'string') {
|
|
228
|
-
return [state.model];
|
|
229
|
-
}
|
|
230
|
-
return [];
|
|
231
|
-
} catch { return []; }
|
|
241
|
+
if (!state.pid) return null;
|
|
242
|
+
try { process.kill(state.pid, 0); }
|
|
243
|
+
catch { return null; }
|
|
244
|
+
return state;
|
|
245
|
+
} catch { return null; }
|
|
232
246
|
}
|
|
233
247
|
|
|
234
248
|
export default async function register(args, ctx) {
|
|
@@ -72,6 +72,23 @@ def main():
|
|
|
72
72
|
full_text += token_text
|
|
73
73
|
emit({"event": "token", "text": token_text})
|
|
74
74
|
|
|
75
|
+
# IPIP-0031 per-layer attribution: after the first generate the
|
|
76
|
+
# session has resolved which DHT peers serve which transformer
|
|
77
|
+
# blocks. Emit that mapping so the control plane can split the
|
|
78
|
+
# CPR receipt across layer-contributing operators by block share.
|
|
79
|
+
try:
|
|
80
|
+
chosen = []
|
|
81
|
+
for s in getattr(session, "chosen_servers", []) or []:
|
|
82
|
+
chosen.append({
|
|
83
|
+
"peer_id": str(getattr(s, "peer_id", "")),
|
|
84
|
+
"start_block": int(getattr(s, "start", getattr(s, "start_block", 0))),
|
|
85
|
+
"end_block": int(getattr(s, "end", getattr(s, "end_block", 0))),
|
|
86
|
+
})
|
|
87
|
+
if chosen:
|
|
88
|
+
emit({"event": "routing", "peers": chosen})
|
|
89
|
+
except Exception as e:
|
|
90
|
+
emit({"event": "log", "warn": f"chosen_servers extract failed: {e}"})
|
|
91
|
+
|
|
75
92
|
for _ in range(max_tokens - 1):
|
|
76
93
|
outputs = model_obj.generate(
|
|
77
94
|
outputs,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infernetprotocol/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.41",
|
|
4
4
|
"description": "GPU-node CLI / daemon for the Infernet Protocol — register a GPU server with a Supabase control plane and start earning.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"ora": "^9.4.0",
|
|
31
31
|
"react": "^17.0.2",
|
|
32
32
|
"react-blessed": "^0.7.2",
|
|
33
|
-
"@infernetprotocol/
|
|
34
|
-
"@infernetprotocol/
|
|
35
|
-
"@infernetprotocol/deploy-providers": "0.1.
|
|
36
|
-
"@infernetprotocol/engine": "0.1.
|
|
37
|
-
"@infernetprotocol/gpu": "0.1.
|
|
33
|
+
"@infernetprotocol/auth": "0.1.41",
|
|
34
|
+
"@infernetprotocol/config": "0.1.41",
|
|
35
|
+
"@infernetprotocol/deploy-providers": "0.1.41",
|
|
36
|
+
"@infernetprotocol/engine": "0.1.41",
|
|
37
|
+
"@infernetprotocol/gpu": "0.1.41"
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
package/examples/app.js
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infernet Protocol - Main Application
|
|
3
|
-
* Demonstrates the use of the Supabase-backed database layer.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import db from '@infernetprotocol/db';
|
|
7
|
-
import config from '../lib/runtime-config.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Initialize the application
|
|
11
|
-
*/
|
|
12
|
-
async function init() {
|
|
13
|
-
try {
|
|
14
|
-
console.log('Initializing Infernet Protocol application...');
|
|
15
|
-
|
|
16
|
-
await db.connect(config.supabase.url);
|
|
17
|
-
|
|
18
|
-
console.log('Application initialized successfully');
|
|
19
|
-
return true;
|
|
20
|
-
} catch (error) {
|
|
21
|
-
console.error('Failed to initialize application:', error);
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Example: Register a new provider node
|
|
28
|
-
* @param {Object} providerData - Provider data
|
|
29
|
-
* @returns {Promise<Object>} - Created provider record
|
|
30
|
-
*/
|
|
31
|
-
async function registerProvider(providerData) {
|
|
32
|
-
try {
|
|
33
|
-
const Provider = db.model('provider');
|
|
34
|
-
const provider = await Provider.register({
|
|
35
|
-
name: providerData.name || `Provider-${Date.now()}`,
|
|
36
|
-
gpu_model: providerData.gpuModel,
|
|
37
|
-
price: providerData.price || 0
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
console.log('Provider registered:', provider);
|
|
41
|
-
return provider;
|
|
42
|
-
} catch (error) {
|
|
43
|
-
console.error('Failed to register provider:', error);
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Example: Submit a new inference job
|
|
50
|
-
* @param {Object} jobData - Job data
|
|
51
|
-
* @returns {Promise<Object>} - Created job record
|
|
52
|
-
*/
|
|
53
|
-
async function submitJob(jobData) {
|
|
54
|
-
try {
|
|
55
|
-
const Job = db.model('job');
|
|
56
|
-
const job = await Job.create({
|
|
57
|
-
title: jobData.title || `Job-${Date.now()}`,
|
|
58
|
-
status: 'pending',
|
|
59
|
-
payment_offer: jobData.paymentOffer,
|
|
60
|
-
model_name: jobData.model,
|
|
61
|
-
client_name: jobData.clientName
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
console.log('Job submitted:', job);
|
|
65
|
-
|
|
66
|
-
if (jobData.isMultiNode) {
|
|
67
|
-
await assignAggregator(job.id);
|
|
68
|
-
} else {
|
|
69
|
-
await assignProvider(job.id);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return job;
|
|
73
|
-
} catch (error) {
|
|
74
|
-
console.error('Failed to submit job:', error);
|
|
75
|
-
throw error;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Example: Assign an aggregator to a multi-node job
|
|
81
|
-
* @param {string} jobId - Job ID
|
|
82
|
-
* @returns {Promise<Object>} - Updated job record
|
|
83
|
-
*/
|
|
84
|
-
async function assignAggregator(jobId) {
|
|
85
|
-
try {
|
|
86
|
-
const Aggregator = db.model('aggregator');
|
|
87
|
-
const Job = db.model('job');
|
|
88
|
-
|
|
89
|
-
const aggregators = await Aggregator.findAvailable();
|
|
90
|
-
if (aggregators.length === 0) {
|
|
91
|
-
throw new Error('No aggregators available');
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const aggregator = aggregators[0];
|
|
95
|
-
const updatedJob = await Job.assignToAggregator(jobId, aggregator.id);
|
|
96
|
-
await Aggregator.updateLoad(aggregator.id, 1);
|
|
97
|
-
|
|
98
|
-
console.log(`Job ${jobId} assigned to aggregator ${aggregator.id}`);
|
|
99
|
-
return updatedJob;
|
|
100
|
-
} catch (error) {
|
|
101
|
-
console.error(`Failed to assign aggregator for job ${jobId}:`, error);
|
|
102
|
-
throw error;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Example: Assign a provider to a single-node job
|
|
108
|
-
* @param {string} jobId - Job ID
|
|
109
|
-
* @returns {Promise<Object>} - Updated job record
|
|
110
|
-
*/
|
|
111
|
-
async function assignProvider(jobId) {
|
|
112
|
-
try {
|
|
113
|
-
const Provider = db.model('provider');
|
|
114
|
-
const Job = db.model('job');
|
|
115
|
-
|
|
116
|
-
const providers = await Provider.findAvailable();
|
|
117
|
-
if (providers.length === 0) {
|
|
118
|
-
throw new Error('No suitable providers available');
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const provider = providers[0];
|
|
122
|
-
const updatedJob = await Job.assignToProvider(jobId, provider.id);
|
|
123
|
-
await Provider.updateStatus(provider.id, 'busy');
|
|
124
|
-
|
|
125
|
-
console.log(`Job ${jobId} assigned to provider ${provider.id}`);
|
|
126
|
-
return updatedJob;
|
|
127
|
-
} catch (error) {
|
|
128
|
-
console.error(`Failed to assign provider for job ${jobId}:`, error);
|
|
129
|
-
throw error;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Example: Cleanup and shutdown
|
|
135
|
-
*/
|
|
136
|
-
async function shutdown() {
|
|
137
|
-
try {
|
|
138
|
-
console.log('Shutting down application...');
|
|
139
|
-
await db.disconnect();
|
|
140
|
-
console.log('Application shutdown complete');
|
|
141
|
-
} catch (error) {
|
|
142
|
-
console.error('Error during shutdown:', error);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export {
|
|
147
|
-
init,
|
|
148
|
-
registerProvider,
|
|
149
|
-
submitJob,
|
|
150
|
-
assignAggregator,
|
|
151
|
-
assignProvider,
|
|
152
|
-
shutdown
|
|
153
|
-
};
|
package/lib/runtime-config.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration settings for Infernet Protocol
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// Load environment variables from .env file
|
|
6
|
-
import dotenv from 'dotenv';
|
|
7
|
-
dotenv.config();
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
// Supabase configuration (self-hosted via `supabase start` or cloud)
|
|
11
|
-
supabase: {
|
|
12
|
-
url: process.env.SUPABASE_URL || 'http://127.0.0.1:54321',
|
|
13
|
-
serviceRoleKey: process.env.SUPABASE_SERVICE_ROLE_KEY,
|
|
14
|
-
schema: process.env.SUPABASE_SCHEMA || 'public'
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
// Server configuration
|
|
18
|
-
server: {
|
|
19
|
-
port: parseInt(process.env.PORT || '3000', 10),
|
|
20
|
-
host: process.env.HOST || '0.0.0.0',
|
|
21
|
-
apiPrefix: process.env.API_PREFIX || '/api/v1',
|
|
22
|
-
corsOrigins: (process.env.CORS_ORIGINS || '*').split(',')
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
// Node configuration
|
|
26
|
-
node: {
|
|
27
|
-
type: process.env.NODE_TYPE || 'provider', // provider, client, or aggregator
|
|
28
|
-
id: process.env.NODE_ID || `node_${Date.now()}`,
|
|
29
|
-
discoveryInterval: parseInt(process.env.DISCOVERY_INTERVAL || '60000', 10), // milliseconds
|
|
30
|
-
bootstrapNodes: (process.env.BOOTSTRAP_NODES || '').split(',').filter(Boolean),
|
|
31
|
-
maxConnections: parseInt(process.env.MAX_CONNECTIONS || '100', 10),
|
|
32
|
-
heartbeatInterval: parseInt(process.env.HEARTBEAT_INTERVAL || '30000', 10), // milliseconds
|
|
33
|
-
enableRemoteSeeding: process.env.ENABLE_REMOTE_SEEDING === 'true' || true, // Enable seeding from remote P2P instance
|
|
34
|
-
remoteNodeUrl: process.env.REMOTE_NODE_URL || 'https://infernetprotocol.com/nodes' // URL to fetch remote nodes from
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
// WebSocket configuration
|
|
38
|
-
websocket: {
|
|
39
|
-
port: parseInt(process.env.WS_PORT || '3001', 10),
|
|
40
|
-
host: process.env.WS_HOST || '0.0.0.0',
|
|
41
|
-
path: process.env.WS_PATH || '/ws',
|
|
42
|
-
heartbeatInterval: parseInt(process.env.WS_HEARTBEAT_INTERVAL || '30000', 10),
|
|
43
|
-
reconnectInterval: parseInt(process.env.WS_RECONNECT_INTERVAL || '5000', 10),
|
|
44
|
-
maxReconnectAttempts: parseInt(process.env.WS_MAX_RECONNECT_ATTEMPTS || '10', 10)
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
// DHT configuration
|
|
48
|
-
dht: {
|
|
49
|
-
bootstrapNodes: (process.env.DHT_BOOTSTRAP_NODES || '').split(',').filter(Boolean),
|
|
50
|
-
kBucketSize: parseInt(process.env.DHT_K_BUCKET_SIZE || '20', 10),
|
|
51
|
-
refreshInterval: parseInt(process.env.DHT_REFRESH_INTERVAL || '3600000', 10), // 1 hour
|
|
52
|
-
staleTimeout: parseInt(process.env.DHT_STALE_TIMEOUT || '900000', 10) // 15 minutes
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
// Docker configuration for task execution
|
|
56
|
-
docker: {
|
|
57
|
-
socketPath: process.env.DOCKER_SOCKET || '/var/run/docker.sock',
|
|
58
|
-
defaultImage: process.env.DEFAULT_DOCKER_IMAGE || 'ubuntu:latest',
|
|
59
|
-
networkMode: process.env.DOCKER_NETWORK_MODE || 'bridge',
|
|
60
|
-
cpuLimit: process.env.DOCKER_CPU_LIMIT,
|
|
61
|
-
memoryLimit: process.env.DOCKER_MEMORY_LIMIT,
|
|
62
|
-
gpuOptions: process.env.DOCKER_GPU_OPTIONS
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
// NOSTR configuration for decentralized identity
|
|
66
|
-
nostr: {
|
|
67
|
-
privateKey: process.env.NOSTR_PRIVATE_KEY,
|
|
68
|
-
publicKey: process.env.NOSTR_PUBLIC_KEY,
|
|
69
|
-
relays: (process.env.NOSTR_RELAYS || 'wss://relay.damus.io,wss://relay.nostr.info').split(','),
|
|
70
|
-
enableNIP05: process.env.NOSTR_ENABLE_NIP05 === 'true' || false,
|
|
71
|
-
nip05Domain: process.env.NOSTR_NIP05_DOMAIN,
|
|
72
|
-
nip05Identifier: process.env.NOSTR_NIP05_IDENTIFIER
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
// Payment configuration
|
|
76
|
-
payment: {
|
|
77
|
-
methods: (process.env.PAYMENT_METHODS || 'lightning,polygon').split(','),
|
|
78
|
-
minimumAmount: parseFloat(process.env.PAYMENT_MINIMUM_AMOUNT || '0.0001'),
|
|
79
|
-
escrowEnabled: process.env.PAYMENT_ESCROW_ENABLED === 'true' || false,
|
|
80
|
-
lightning: {
|
|
81
|
-
nodeUrl: process.env.LIGHTNING_NODE_URL,
|
|
82
|
-
macaroon: process.env.LIGHTNING_MACAROON,
|
|
83
|
-
certificatePath: process.env.LIGHTNING_CERTIFICATE_PATH,
|
|
84
|
-
invoiceExpirySeconds: parseInt(process.env.LIGHTNING_INVOICE_EXPIRY || '3600', 10)
|
|
85
|
-
},
|
|
86
|
-
polygon: {
|
|
87
|
-
rpcUrl: process.env.POLYGON_RPC_URL,
|
|
88
|
-
privateKey: process.env.POLYGON_PRIVATE_KEY,
|
|
89
|
-
contractAddress: process.env.POLYGON_CONTRACT_ADDRESS,
|
|
90
|
-
gasLimit: parseInt(process.env.POLYGON_GAS_LIMIT || '250000', 10)
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
// Security configuration
|
|
95
|
-
security: {
|
|
96
|
-
encryptionKey: process.env.ENCRYPTION_KEY,
|
|
97
|
-
jwtSecret: process.env.JWT_SECRET,
|
|
98
|
-
jwtExpiryHours: parseInt(process.env.JWT_EXPIRY_HOURS || '24', 10),
|
|
99
|
-
useSecureEnclave: process.env.USE_SECURE_ENCLAVE === 'true' || false,
|
|
100
|
-
rateLimitRequests: parseInt(process.env.RATE_LIMIT_REQUESTS || '100', 10),
|
|
101
|
-
rateLimitWindowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS || '900000', 10) // 15 minutes
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
// Logging configuration
|
|
105
|
-
logging: {
|
|
106
|
-
level: process.env.LOG_LEVEL || 'info',
|
|
107
|
-
format: process.env.LOG_FORMAT || 'json',
|
|
108
|
-
file: process.env.LOG_FILE || './logs/infernet.log',
|
|
109
|
-
maxSize: parseInt(process.env.LOG_MAX_SIZE || '10485760', 10), // 10MB
|
|
110
|
-
maxFiles: parseInt(process.env.LOG_MAX_FILES || '5', 10),
|
|
111
|
-
console: process.env.LOG_TO_CONSOLE !== 'false'
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
// Content delivery configuration
|
|
115
|
-
contentDelivery: {
|
|
116
|
-
storageDir: process.env.CONTENT_STORAGE_DIR || './storage',
|
|
117
|
-
maxContentSize: parseInt(process.env.MAX_CONTENT_SIZE || '10737418240', 10), // 10GB default
|
|
118
|
-
tempDir: process.env.TEMP_DIR || './tmp',
|
|
119
|
-
cleanupInterval: parseInt(process.env.CLEANUP_INTERVAL || '3600000', 10), // 1 hour
|
|
120
|
-
contentExpiryHours: parseInt(process.env.CONTENT_EXPIRY_HOURS || '24', 10)
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
// Job execution configuration
|
|
124
|
-
jobs: {
|
|
125
|
-
maxConcurrent: parseInt(process.env.MAX_CONCURRENT_JOBS || '5', 10),
|
|
126
|
-
timeout: parseInt(process.env.JOB_TIMEOUT || '3600000', 10), // 1 hour default
|
|
127
|
-
retryLimit: parseInt(process.env.JOB_RETRY_LIMIT || '3', 10),
|
|
128
|
-
retryDelay: parseInt(process.env.JOB_RETRY_DELAY || '60000', 10) // 1 minute
|
|
129
|
-
}
|
|
130
|
-
};
|