CC-2651: import idicator
- Threshold is 10 seconds - record timestamp once every 5 seconds - "File import inprogress..." displays above search box - pyinotify read_freq changed to 0.1 from 1
This commit is contained in:
parent
05b2a9679b
commit
968c0f96a2
6 changed files with 10 additions and 8 deletions
|
@ -244,7 +244,7 @@ class MusicDir {
|
|||
{
|
||||
if(!is_dir($p_dir)){
|
||||
return array("code"=>2, "error"=>"'$p_dir' is not a valid directory.");
|
||||
}else if(Application_Model_Preference::GetImportTimestamp()+10 > $now){
|
||||
}else if(Application_Model_Preference::GetImportTimestamp()+10 > time()){
|
||||
return array("code"=>3, "error"=>"Airtime is currently importing files. Please wait until this is complete before changing the storage directory.");
|
||||
}
|
||||
$dir = self::getStorDir();
|
||||
|
|
|
@ -359,8 +359,10 @@ class Application_Model_Preference
|
|||
|
||||
public static function SetImportTimestamp(){
|
||||
$now = time();
|
||||
if(Application_Model_Preference::GetImportTimestamp()+5 < $now){
|
||||
Application_Model_Preference::SetValue("import_timestamp", $now);
|
||||
}
|
||||
}
|
||||
|
||||
public static function GetImportTimestamp(){
|
||||
return Application_Model_Preference::GetValue("import_timestamp");
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<!--<li><a href="#advancedSearch">Advanced Search</a></li>-->
|
||||
</ul>
|
||||
<div id="simpleSearch">
|
||||
<div id="import_status" style="visibility:hidden">File import in progress...</div>
|
||||
<table id="library_display" cellpadding="0" cellspacing="0" class="datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
@ -57,13 +57,11 @@ function confirmDeletePlaylist(params){
|
|||
|
||||
function checkImportStatus(){
|
||||
$.getJSON('/Preference/is-import-in-progress', function(data){
|
||||
var div = $('#library_display_processing');
|
||||
var div = $('#import_status');
|
||||
if(data == true){
|
||||
div.html("File import in progress...");
|
||||
div.css('visibility', 'visible');
|
||||
}else{
|
||||
div.css('visibility', 'hidden');
|
||||
div.html("Processing...");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ try:
|
|||
bootstrap = AirtimeMediaMonitorBootstrap(logger, pe, api_client, mmc)
|
||||
bootstrap.scan()
|
||||
|
||||
notifier = AirtimeNotifier(wm, pe, read_freq=1, timeout=0, airtime_config=config, api_client=api_client, bootstrap=bootstrap, mmc=mmc)
|
||||
notifier = AirtimeNotifier(wm, pe, read_freq=0.1, timeout=0, airtime_config=config, api_client=api_client, bootstrap=bootstrap, mmc=mmc)
|
||||
notifier.coalesce_events()
|
||||
|
||||
#create 5 worker threads
|
||||
|
|
|
@ -178,7 +178,8 @@ class AirtimeProcessEvent(ProcessEvent):
|
|||
self.mmc.touch_index_file()
|
||||
|
||||
self.file_events = []
|
||||
|
||||
#yeild to workder thread
|
||||
time.sleep(0)
|
||||
#use items() because we are going to be modifying this
|
||||
#dictionary while iterating over it.
|
||||
for k, pair in self.cookies_IN_MOVED_FROM.items():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue