123456789101112131415161718192021222324 |
- # -*- coding: utf-8 -*-
- """
- demeter web
- name:admin.py
- author:rabin
- """
- import time
- from demeter.core import *
- timeSleep = 36000
- # 批量控制的队列清理,10小时清理一次24小时之前完成的数据
- class Queuedrop(object):
- def run(self):
- self.handle()
- time.sleep(timeSleep)
- def handle(self):
- num = 3600*24
- model = Demeter.model('device_mul_queue')
- model.status = 4
- cur = Demeter.time() - num
- model.operdate.assign(cur, '<=')
- model.delete()
|