<div dir="ltr"><div><div><div><div>I think You are missing initialization for running period tasks. You need  prepare a daemon service with period tasks like nova-compute<br></div></div>There are some key points to enable period task:<br><br></div>1. add period tasks to thread group <br>  <a href="https://github.com/openstack/nova/blob/master/nova/service.py#L194">https://github.com/openstack/nova/blob/master/nova/service.py#L194</a><br><br></div>2. make manager class inherit from <span class="gmail-pl-e">periodic_task</span>.<span class="gmail-pl-e">PeriodicTasks</span><div>  <a href="https://github.com/openstack/nova/blob/master/nova/manager.py#L91">https://github.com/openstack/nova/blob/master/nova/manager.py#L91</a><br><br></div><div>3. run service as daemon <br> <a href="https://github.com/openstack/nova/blob/master/nova/cmd/compute.py#L56">https://github.com/openstack/nova/blob/master/nova/cmd/compute.py#L56</a><br></div><div><div><div><div><div><div><br><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-08-14 17:50 GMT+08:00 zhi <span dir="ltr"><<a href="mailto:changzhi1990@gmail.com" target="_blank">changzhi1990@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, all.<div><br></div><div>    There are two ways to run period tasks in OpenStack. One is using "FixedIntervalLoopingCall" and the other is using the decorator named "periodic_task.periodic_task". Both of them are defining in Oslo service module.</div><div><br></div><div>    My question is, how to use them in non OpenStack environment? In other words, how to use them in our own private projects? I have some demo codes at [1] and [2]. But may be there is something wrong with them. They didn't run periodically.</div><div><br></div><div>    Could someone give me some advice?</div><div><br></div><div><br></div><div>Thanks.</div><div>Zhi</div><div><br></div><div><br></div><div>[1]: <a href="http://paste.openstack.org/show/618295/" target="_blank">http://paste.openstack.<wbr>org/show/618295/</a></div><div>[2]: <a href="http://paste.openstack.org/show/618296/" target="_blank">http://paste.openstack.<wbr>org/show/618296/</a></div></div>
<br>______________________________<wbr>______________________________<wbr>______________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.<wbr>openstack.org?subject:<wbr>unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>ChangBo Guo(gcb)</div></div></div>
</div>