Changeset - 7f26f813806e
[Not reviewed]
Dennis Fink - 9 years ago 2016-05-16 17:30:00
dennis.fink@c3l.lu
Fix
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
ennstatus/api/model.py
Show inline comments
 
@@ -246,26 +246,29 @@ class Server:
 
        )
 
        self.mean_consensus_weight_fraction = calculate_weight(
 
            data.consensus_weight_fraction
 
        )
 

	
 
    def update_flags(self):
 

	
 
        try:
 
            data = manager.query('details', lookup=self.fingerprint)
 
        except:
 
            raise NotImplementedError
 

	
 
        try:
 
        if data is not None:
 
            self.flags = data.relays[0].flags
 
        else:
 
            raise NotImplementedError
 
        except IndexError as e:
 
            raise NotImplementedError from e
 

	
 
    def check_status(self):
 

	
 
        now = datetime.utcnow()
 
        delta = now - self.last_updated
 

	
 
        if delta.seconds >= 3600:
 
            self.status = False
 
        elif delta.seconds >= 600:
 
            self.status = None
0 comments (0 inline, 0 general)