latest conversion changes 02052024
This commit is contained in:
parent
62bf265236
commit
31ef7d4e27
|
@ -57,8 +57,9 @@ def run_conversion(msg):
|
|||
background_thread = threading.Thread(target=background_execution, args=(obj,))
|
||||
background_thread.start()
|
||||
background_thread.join()
|
||||
s3_client.delete_object(Bucket='conversion-kitchen', Key=object_key)
|
||||
msg.delete()
|
||||
|
||||
|
||||
|
||||
def run_audit(msg):
|
||||
body_dict = json.loads(msg.body)
|
||||
|
|
|
@ -510,14 +510,12 @@ class Conversion:
|
|||
try:
|
||||
response = s3_client.upload_file(filee, bucket, object_name)
|
||||
s3_url = f"https://{bucket}.s3.ap-south-1.amazonaws.com/{object_name}"
|
||||
self.translated_script_object.translated_script_pdf = s3_url
|
||||
|
||||
print(response)
|
||||
except Exception as e:
|
||||
print("Error is", e)
|
||||
|
||||
|
||||
|
||||
|
||||
else:
|
||||
|
||||
"""Blockchain Upload Starts here"""
|
||||
|
@ -553,7 +551,10 @@ class Conversion:
|
|||
userkey = decryptionOfPrivate(userPrivateKey)
|
||||
tx_id, tx_gas_fee = UploadConversionData(OWNER_KEY, blockchain_obj.publicKey, UserId, str(Project),
|
||||
Data)
|
||||
|
||||
print("Tx id -> ", tx_id,tx_gas_fee)
|
||||
print(type(tx_id))
|
||||
|
||||
# user_infos = user_info(tx_hash=tx_id, service="Conversion", gas_fee=2345432345123456)
|
||||
# addition_result = user_infos.update_info(request)
|
||||
try:
|
||||
|
@ -582,10 +583,14 @@ class Conversion:
|
|||
|
||||
"""Blockchain Upload Ends here"""
|
||||
|
||||
|
||||
|
||||
|
||||
"""Process Completed"""
|
||||
self.translated_script_object.status = "Completed"
|
||||
try:
|
||||
self.translated_script_object.blockchain_txhash = tx_id
|
||||
except:
|
||||
self.translated_script_object.translated_script_pdf = s3_url
|
||||
self.translated_script_object.save()
|
||||
|
||||
return self.response
|
||||
|
|
|
@ -290,6 +290,7 @@ class ScriptTranslations(models.Model):
|
|||
left_dual_dial_script = models.CharField(max_length=220, null=True, blank=True)
|
||||
free_output = models.BooleanField(default=False)
|
||||
status = models.CharField(max_length=220, null=True, blank=True)
|
||||
blockchain_txhash = models.CharField(max_length=220, null=True, blank=True)
|
||||
error_desc = models.CharField(max_length=2000, null=True, blank=True)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue