Merge branch 'saas' into saas-dev

This commit is contained in:
Albert Santoni 2015-05-19 12:18:54 -04:00
commit 1c88d6dccd
2 changed files with 10 additions and 15 deletions

View File

@ -3,12 +3,11 @@
font-size: 200px !important; font-size: 200px !important;
} }
</style> </style>
<?php $upgradeLink = Application_Common_OsPath::getBaseDir() . "billing/upgrade"; ?>
<?php if ($this->quotaLimitReached) { ?> <?php if ($this->quotaLimitReached) { ?>
<div class="errors quota-reached"> <div class="errors quota-reached">
Disk quota exceeded. You cannot upload files until you <?php printf(_pro("Disk quota exceeded. You cannot upload files until you %s upgrade your storage"),
<a target="_parent" href=<?php $baseUrl = Application_Common_OsPath::getBaseDir(); echo $baseUrl . "billing/upgrade"?>> "<a target=\"_parent\" href=$upgradeLink>");?></a>.
upgrade your storage
</a>.
</div> </div>
<?php <?php
} }

View File

@ -3,12 +3,8 @@ import json
import logging import logging
import collections import collections
import Queue import Queue
import subprocess
import multiprocessing
import time import time
import sys
import traceback import traceback
import os
import pickle import pickle
import threading import threading
from urlparse import urlparse from urlparse import urlparse
@ -158,23 +154,23 @@ class StatusReporter():
''' We use multiprocessing.Process again here because we need a thread for this stuff ''' We use multiprocessing.Process again here because we need a thread for this stuff
anyways, and Python gives us process isolation for free (crash safety). anyways, and Python gives us process isolation for free (crash safety).
''' '''
_ipc_queue = multiprocessing.Queue() _ipc_queue = Queue.Queue()
#_request_process = multiprocessing.Process(target=process_http_requests, #_http_thread = multiprocessing.Process(target=process_http_requests,
# args=(_ipc_queue,)) # args=(_ipc_queue,))
_request_process = None _http_thread = None
@classmethod @classmethod
def start_thread(self, http_retry_queue_path): def start_thread(self, http_retry_queue_path):
StatusReporter._request_process = threading.Thread(target=process_http_requests, StatusReporter._http_thread = threading.Thread(target=process_http_requests,
args=(StatusReporter._ipc_queue,http_retry_queue_path)) args=(StatusReporter._ipc_queue,http_retry_queue_path))
StatusReporter._request_process.start() StatusReporter._http_thread.start()
@classmethod @classmethod
def stop_thread(self): def stop_thread(self):
logging.info("Terminating status_reporter process") logging.info("Terminating status_reporter process")
#StatusReporter._request_process.terminate() # Triggers SIGTERM on the child process #StatusReporter._http_thread.terminate() # Triggers SIGTERM on the child process
StatusReporter._ipc_queue.put("shutdown") # Special trigger StatusReporter._ipc_queue.put("shutdown") # Special trigger
StatusReporter._request_process.join() StatusReporter._http_thread.join()
@classmethod @classmethod
def _send_http_request(self, request): def _send_http_request(self, request):