@@ -15,5 +15,8 @@ Demeter.echo(Demeter.option['method'])
method = Demeter.option['method']
cron = Demeter.service(method, 'cron')
-while(True):
- cron.handle()
+if 'mqtt_' in method:
+ cron.run()
+else:
+ while(True):
@@ -4,10 +4,14 @@
name:sub.py
author:rabin
"""
+import time
+from demeter.core import *
from demeter.mqtt import *
+timeSleep = 1000
import random
class Mqtt_sub(object):
- Sub()
+ def run(self):
+ Sub()
data = {}
@@ -6,7 +6,7 @@
import time
from demeter.core import *
-timeSleep = 10
+timeSleep = 60
# 设置过期时间
class Timing(object):