Skip to content

Timesync.serverTime running each sec in nonReactive mode #20

Description

@aashuagg

I want to access server time on client side though only when queried for. So I have a function to get the current server time non-reactively:

getServerTime = function() {
    var serverTime;
    if (!TimeSync.isSynced()) {
        TimeSync.resync();
    } else {
        serverTime = Deps.nonreactive(function() {
            return TimeSync.serverTime();
        })
    }
    return serverTime;
}

It used to work fine in meteor 0.8.3 but now I have upgraded to meteor 1.0 and TimeSync.serverTime runs continuously causing my subscribes to run infinitely.

Does it need some change for meteor 1.0?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions