changed RequestSync to use injected apc and injected it in ThreadedRequestedSync.
This commit is contained in:
parent
15f4212360
commit
fa66f33ffa
|
@ -1,14 +1,12 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import threading
|
|
||||||
|
|
||||||
from media.monitor.exceptions import BadSongFile
|
from media.monitor.exceptions import BadSongFile
|
||||||
from media.monitor.log import Loggable
|
from media.monitor.log import Loggable
|
||||||
import api_clients.api_client as ac
|
from media.saas.thread import apc, InstanceInheritingThread
|
||||||
|
|
||||||
class ThreadedRequestSync(threading.Thread, Loggable):
|
class ThreadedRequestSync(InstanceInheritingThread, Loggable):
|
||||||
def __init__(self, rs):
|
def __init__(self, rs):
|
||||||
threading.Thread.__init__(self)
|
super(ThreadedRequestSync, self).__init__()
|
||||||
self.rs = rs
|
self.rs = rs
|
||||||
self.daemon = True
|
self.daemon = True
|
||||||
self.start()
|
self.start()
|
||||||
|
@ -22,7 +20,7 @@ class RequestSync(Loggable):
|
||||||
for some number of times """
|
for some number of times """
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_with_api_client(cls, watcher, requests):
|
def create_with_api_client(cls, watcher, requests):
|
||||||
apiclient = ac.AirtimeApiClient.create_right_config()
|
apiclient = apc()
|
||||||
self = cls(watcher, requests, apiclient)
|
self = cls(watcher, requests, apiclient)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue