This question has been flagged
2 Replies
5348 Views

Hello every one,

Here i want perform a particular action, after 5 minutes.

please let me know, is there any way to ahieve this?

and i tried this

import time

import datetime

print "Loop Started"

while
    time.sleep(5)
    print "loop is running"

 

Thanks in advance....

 

 

Avatar
Discard
Best Answer

Hi,

You can create scheduler(ir.cron) with Interval of 5 min to run particular action. You may refer Fetchmail Service cron which runs at every 5 minutes. 

Avatar
Discard
Author Best Answer

Nehal @ Can you explain briefly please?

Avatar
Discard

You can create method in your py file. and then create ir.cron from xml file. You can refer example from your_addons/fetchmail/fetchmail_data.xml file and _fetch_mails function of fetchmail.py file