Attempting threading for long-runing system processes
This commit is contained in:
@ -48,6 +48,12 @@ export function restart(){
|
||||
}
|
||||
}
|
||||
|
||||
export function runLocalScan(){
|
||||
return {
|
||||
type: 'PUSHER_RUN_LOCAL_SCAN'
|
||||
}
|
||||
}
|
||||
|
||||
export function getConnections(){
|
||||
return {
|
||||
type: 'PUSHER_GET_CONNECTIONS'
|
||||
|
||||
@ -618,6 +618,11 @@ const PusherMiddleware = (function(){
|
||||
);
|
||||
break
|
||||
|
||||
|
||||
/**
|
||||
* Notifications and alerts
|
||||
**/
|
||||
|
||||
case 'PUSHER_BROWSER_NOTIFICATION':
|
||||
store.dispatch(uiActions.createBrowserNotification(action))
|
||||
break
|
||||
@ -632,6 +637,11 @@ const PusherMiddleware = (function(){
|
||||
store.dispatch(uiActions.createNotification(data));
|
||||
break
|
||||
|
||||
|
||||
/**
|
||||
* Server actions
|
||||
**/
|
||||
|
||||
case 'PUSHER_RELOAD':
|
||||
// Hard reload. This doesn't strictly clear the cache, but our compiler's
|
||||
// cache buster should handle that
|
||||
@ -666,6 +676,21 @@ const PusherMiddleware = (function(){
|
||||
);
|
||||
break;
|
||||
|
||||
case 'PUSHER_RUN_LOCAL_SCAN':
|
||||
if (store.getState().ui.allow_reporting){
|
||||
ReactGA.event({ category: 'Pusher', action: 'Run local scan', label: '' });
|
||||
}
|
||||
request(store, 'run_local_scan')
|
||||
.then(
|
||||
response => {
|
||||
store.dispatch(mopidyActions.localScanRunning());
|
||||
},
|
||||
error => {
|
||||
store.dispatch(uiActions.createNotification({content: error.message, description: (error.description ? error.description : null), type: 'bad'}));
|
||||
}
|
||||
);
|
||||
break;
|
||||
|
||||
case 'PUSHER_VERSION':
|
||||
if (store.getState().ui.allow_reporting){
|
||||
ReactGA.event({ category: 'Pusher', action: 'Version', label: action.version.current });
|
||||
|
||||
Reference in New Issue
Block a user