forked from totallylegitco/fighthealthinsurance
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve fax backend (totallylegitco#115)
* ftp from inside a k8s cluster is... not ideal * Addd migration * Only include claim id and fax name if it's more than two char
- Loading branch information
Showing
30 changed files
with
466 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ __pycache__ | |
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
*.pyc | ||
|
||
# C extensions | ||
*.so | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
import os | ||
|
||
import ray | ||
from fighthealthinsurance.ray import * | ||
import asyncio | ||
import time | ||
|
||
name = "EmailPollingActor" | ||
|
||
|
||
@ray.remote | ||
@ray.remote(max_restarts=-1, max_task_retries=-1) | ||
class EmailPollingActor: | ||
def __init__(self): | ||
print(f"Starting actor") | ||
time.sleep(1) | ||
# This is a bit of a hack but we do this so we have the app configured | ||
from configurations.wsgi import get_wsgi_application | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fighthealthinsurance.settings") | ||
application = get_wsgi_application() | ||
print(f"wsgi started") | ||
# Now we can import the follow up e-mails logic | ||
from fighthealthinsurance.followup_emails import * | ||
from fighthealthinsurance.followup_emails import FollowUpEmailSender | ||
|
||
self.sender = FollowUpEmailSender | ||
self.sender = FollowUpEmailSender() | ||
print(f"Sender started") | ||
|
||
async def run(self): | ||
def run(self): | ||
print(f"Starting run") | ||
self.running = True | ||
while self.running: | ||
try: | ||
print(self.sender.find_candidates) | ||
await asyncio.sleep(1) | ||
print(f"Top candidates: {self.sender.find_candidates()[0:4]}") | ||
time.sleep(10) | ||
except Exception as e: | ||
print(f"Error {e} while checking messages.") | ||
|
||
print(f"Done running? what?") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.