Scheduled task failing on linked report

(3 posts) (2 voices)

Tags:

No tags yet.

  1. Rbert, Member

    Hello,

    I have a report that makes a GET request, and then calls itself to handle the data:

    DROP PROCEDURE IF EXISTS sp_DBR_weather_forecast_dumper
    $$
    CREATE PROCEDURE `sp_DBR_weather_forecast_dumper`(
    inParamJson text,
    inId int(11)
    )
    BEGIN
    declare _stage varchar(255);
    declare xml_string text; set @url = "https://xmlweather.vedur.is/?op_w=xml&type=forec&view=xml&lang=en&ids=1&params=F;FX;FG;D;T;W;V;N;P;RH;SNC;SND;SED;RTE;TD;R"; if json_valid(inParamJson) and inParamJson ->> '$.stage' is not null then
    set _stage = inParamJson ->> "$.stage";
    else
    set _stage = '';
    end if; if _stage = '' then
    select 'dbr.report', 'sp_DBR_weather_forecast_dumper', 'inId=id', 'inParamJson=p_json';
    select 'dbr.http.save', 'sp_save_json';
    select 'dbr.http.get', @url, json_object('stage', 'got_data') as p_json;
    elseif _stage = 'got_data' then
    set xml_string = (select content from AhaInfo.http_json where id = inId); ... Some processing ... end if; END
    $$

    Now, I want to schedule runs of this report every hour, which I tried to use the scheduling feature for. However, the runs are failing with a HTTP response code 302. The report runs fine when I manually run it.

    Do you know what is happening here? Thank you.

  2. myDBR Team, Key Master

    You can run the updater which will allow the redirects in scheduled reports.

    --
    myDBR Team

  3. Rbert, Member

    Works, thank you!


Reply

You must log in to post.