[Kimchi-devel] [PATCH] [Wok] Save notifications in memory instead of object store

Lucio Correia luciojhc at linux.vnet.ibm.com
Mon May 9 17:19:37 UTC 2016


On 09-05-2016 13:49, Aline Manera wrote:
>
>
> On 05/09/2016 01:28 PM, Lucio Correia wrote:
>> On 09-05-2016 11:57, Aline Manera wrote:
>>>
>>>
>>> On 05/06/2016 06:09 PM, Lucio Correia wrote:
>>>> Notifications are temporary data structure, so save it in
>>>> memory instead of object store, allowing it to work even
>>>> when there is no disk space.
>>>>
>>>> Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
>>>> ---
>>>>   src/wok/control/notifications.py |  6 +++++
>>>>   src/wok/model/notifications.py   | 52
>>>> +++++++++++++++++++++++++++++-----------
>>>>   src/wok/objectstore.py           | 36 ----------------------------
>>>>   src/wok/server.py                |  4 ----
>>>>   4 files changed, 44 insertions(+), 54 deletions(-)
>>>>
>>>> diff --git a/src/wok/control/notifications.py
>>>> b/src/wok/control/notifications.py
>>>> index 37d45f2..b57595e 100644
>>>> --- a/src/wok/control/notifications.py
>>>> +++ b/src/wok/control/notifications.py
>>>> @@ -21,6 +21,11 @@ from wok.control.base import Collection, Resource
>>>>   from wok.control.utils import UrlSubNode
>>>>
>>>>
>>>> +NOTIFICATION_REQUESTS = {
>>>> +    'DELETE': {'default': "UI notification deleted: %(ident)s"},
>>>> +}
>>>> +
>>>> +
>>>>   @UrlSubNode('notifications', True)
>>>>   class Notifications(Collection):
>>>>       def __init__(self, model):
>>>> @@ -31,6 +36,7 @@ class Notifications(Collection):
>>>>   class Notification(Resource):
>>>>       def __init__(self, model, id):
>>>>           super(Notification, self).__init__(model, id)
>>>> +        self.log_map = NOTIFICATION_REQUESTS
>>>
>>> Should we log notifications events on user log activity?
>>>
>>> User log activity is to record any action user took on Wok.
>>> Although the user may close the notification box on UI, it should be
>>> transparent to user and do not impact the system.
>>
>> Yes, I did it because it's user action.
>>
>> What impacts do you refer to?
>>
>
> It does not change the system configuration. It is only an internal
> mechanism used by Wok to notify user about something.

OK, I will send V2 without that.

-- 
Lucio Correia
Software Engineer
IBM LTC Brazil




More information about the Kimchi-devel mailing list