From 9b0f4269c48d9fd8dcb67b1171ed3a5ac5243195 Mon Sep 17 00:00:00 2001 From: Andrei Petre Date: Fri, 22 Mar 2013 19:17:12 +0200 Subject: [PATCH 1/2] Init channel with time_of_reference_expiry as (new Date).getTime(). #69 --- core/datasource/datasource.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/datasource/datasource.coffee b/core/datasource/datasource.coffee index d0d7908..736e602 100644 --- a/core/datasource/datasource.coffee +++ b/core/datasource/datasource.coffee @@ -133,7 +133,12 @@ define [ # to be available ASAP, e.g. on /new_widget events # In theory, this won't longer be needed after we fix # issue https://github.com/uberVU/mozaic/issues/54 - @reference_data[channel_guid] = {} + @reference_data[channel_guid] = { + 'reference_count': 0 + # Initial timestamp for channel, to know when to + # garbage collect it. + 'time_of_reference_expiry': (new Date).getTime() + } resource_type = @config.channel_types[channel_type].type if resource_type == 'relational' From 7c7e3a4dcedafc616a1cbbc4393bc080dad48a00 Mon Sep 17 00:00:00 2001 From: Andrei Petre Date: Fri, 22 Mar 2013 19:36:44 +0200 Subject: [PATCH 2/2] Remove reference_count, it's added elsewhere. #69 --- core/datasource/datasource.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/core/datasource/datasource.coffee b/core/datasource/datasource.coffee index 736e602..10e56e1 100644 --- a/core/datasource/datasource.coffee +++ b/core/datasource/datasource.coffee @@ -134,7 +134,6 @@ define [ # In theory, this won't longer be needed after we fix # issue https://github.com/uberVU/mozaic/issues/54 @reference_data[channel_guid] = { - 'reference_count': 0 # Initial timestamp for channel, to know when to # garbage collect it. 'time_of_reference_expiry': (new Date).getTime()