Skip to content

The sample MPD widget spawns an exponential amount of timers when no connection can be made #148

@potamides

Description

@potamides

Hello,
while integrating MPD into my rice i stumbled over a bug in the sample widget on the awesome website. The sample widget uses this error handler:

local function error_handler(err)
    mpd_widget:set_text("Error: " .. tostring(err))
    -- Try a reconnect soon-ish
    timer.start_new(10, function()
        connection:send("ping")
    end)
end

When mpc:_connect fails and try_reconnect is false this method gets called two times and thus two timers are created. Each timer then again calls mpc:_connect. When no connection can be made, after some time this completely stops awesome from working.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions