trm has asked for the wisdom of the Perl Monks concerning the following question:
I've been looking at the Schedule::Cron module to handle some schduling that seems to be perfectly suited for the module. I need to be able to add, remove and update events on the fly. For adding new events, it works great. However, when I update an event with a new timespec it doesn't seem to register it, unless I am adding a new event at the same time - not a real problem, I worked around it with a delete and add.
When I delete an event, the deletion works fine, however, the indexes of the other events get lost if they were added to the list after the deleted one was originally added. When check_event(ID) gets executed, the index that is returned is the "old" index before the deletion, where the index should be one value lower.
I looked at the code for the module, and it appears that there is a "map" and a "time_table" structure. The time_table appears to contain the acutal values of the cron events in an array format (ordered list) and the map points to the indexes as they are added to the list. However, I don't see anywhere in the code that updates the ordering after an entry is deleted.
So after my long winded explanation, my question is, is there a way to re-map the list, or should I be calling list_entries and searching as opposed to check_entry?
Thanks for any help.
|
|---|