def sendHisData(self,record):
try:
self.main.db.open()
sock = SockClient
(self.main.config.host,self.main.config.port)
sock.connect()
for r in record:
sock_cmd = '@'.join
([r.DeviceId,r.Monitor,r.Value,r.isAlarm ,'2',str(r.time)])
sock.send(sock_cmd)
self.main.db.delete(record)
self.main.db.commit()
self.main.db.cleanup()
self.main.db.close()
sock.close()
except Exception,e:
errlog.debug(traceback.format_exc())
finally:
self.main.setFlag()
self.main.db.open()
record = []
for i,rec in enumerate(self.main.db):
record.append(rec)
if i > 5000:
break
self.main.db.close()
if len(record) > 0:
thread.start_new_thread(self.sendHisData,
(record,))
first i select from the database,put results into the record,and
second i start a thread of function sendHisData,also put the record
into it.
then i got that error.
i have made annother test.i telnet on the busybox system(arm9),and
start python
on the prompt,i input
>>> from buzhug import Base
>>> db = Base('data.db')
>>> db.open()
>>> db.cleanup()
then it also tell me the error 'IOError: [Errno 28] No space left on
device'
my busybox system device is little device that has less memory,
so i guess maybe the method of cleanup will loading the whole database
files into the memory.
that will making the error.
so i am puzzled.
any advice?