Skip to content

Commit

Permalink
Merge pull request #523 from MetaPhase-Consulting/update/threading
Browse files Browse the repository at this point in the history
Implement threading for email function
  • Loading branch information
mjoyce91 authored May 6, 2021
2 parents 7d28b55 + f2cef08 commit fef05f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions talentmap_api/common/common_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re
import pydash
import json
import threading

from pydoc import locate

Expand Down Expand Up @@ -517,6 +518,11 @@ def sendBidHandshakeNotification(owner, message, tags=[], meta={}):


def send_email(subject = '', body = '', recipients = []):
th = threading.Thread(target=send_email_thread, args=(subject,body,recipients))
th.start()


def send_email_thread(subject = '', body = '', recipients = []):
if EMAIL_ENABLED:
if EMAIL_IS_DEV:
recipients = [EMAIL_DEV_TO]
Expand Down
4 changes: 2 additions & 2 deletions talentmap_api/fsbid/services/bid.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def submit_bid_on_position(employeeId, cyclePositionId, jwt_token):

def register_bid_on_position(employeeId, cyclePositionId, jwt_token):
'''
Submits a bid on a position
Registers a bid on a position
'''
ad_id = jwt.decode(jwt_token, verify=False).get('unique_name')
url = f"{API_ROOT}/bids/handshake/?cp_id={cyclePositionId}&perdet_seq_num={employeeId}&ad_id={ad_id}&hs_cd=HS"
Expand All @@ -76,7 +76,7 @@ def register_bid_on_position(employeeId, cyclePositionId, jwt_token):

def unregister_bid_on_position(employeeId, cyclePositionId, jwt_token):
'''
Submits a bid on a position
Unregisters a bid on a position
'''
ad_id = jwt.decode(jwt_token, verify=False).get('unique_name')
url = f"{API_ROOT}/bids/handshake/?cp_id={cyclePositionId}&perdet_seq_num={employeeId}&ad_id={ad_id}"
Expand Down

0 comments on commit fef05f1

Please sign in to comment.