Skip to content

Commit e369143

Browse files
committed
move job_id to cli
1 parent a6b301a commit e369143

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

src/satextractor/deployer/gcp_deployer.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
import concurrent
2-
import hashlib
32
import json
4-
from datetime import datetime
53

64
from google.cloud import pubsub_v1
75
from loguru import logger
86
from satextractor.models.constellation_info import BAND_INFO
97
from tqdm import tqdm
108

119

12-
def deploy_tasks(credentials, extraction_tasks, storage_path, chunk_size, topic):
13-
14-
user_id = topic.split("/")[-1].split("-")[0]
15-
16-
job_id = hashlib.sha224(
17-
(user_id + str(datetime.now())).encode(),
18-
).hexdigest()[:10]
10+
def deploy_tasks(
11+
job_id,
12+
credentials,
13+
extraction_tasks,
14+
storage_path,
15+
chunk_size,
16+
topic,
17+
):
1918

2019
logger.info(f"Deploying {len(extraction_tasks)} tasks with job_id: {job_id}")
2120

0 commit comments

Comments
 (0)