1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Async task spam!

Discussion in 'Development' started by Bad and Boujee, Jul 14, 2017.

  1. Bad and Boujee

    Bad and Boujee Creeper

    Messages:
    4
    GitHub:
    None
    Okay so I have this async task


    Here's the code:

    PHP:
    class Test extends AsyncTask {


        public function 
    __construct(Main $plugin){
            
    parent::__construct($plugin);
        }

        public function 
    onRun(){


            
    $d file_get_contents("/home/badandboujee/test.json");
            
    $badAndBou json_decode($dtrue);

            
    $this->setResult($badAndBou['Data1']['Data5']);
        }

        public function 
    onCompletion(Server $server){
            
    $server->getLogger()->info($this->getResult()); // Seems to echo the data.
        
    }
    }
    But this message get log! WHY??

    PHP:
    xx stored local complex data but did not remove them after completion
    xx is the fill class path etc...
     
  2. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    can we see setResult function in your Main class?
     
  3. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    Pretty sure it's this one from the AsyncTask class, not the main class.
     
  4. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    my bad! ive never worked with async tasks
     
  5. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    weird, you do not seem to use any local complexes? are you sure you don't use them somewhere? setResult shouldn't be a local complex so i am confused...
    @SOFe might have the solution, he wrote that local complex stuff. Never got to work with it yet.
     
  6. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Because this is an AsyncTask not a PluginTask, and you shouldn't call parent::__construct() with any values unless you're gonna use them.
     
    SalmonDE likes this.
  7. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    oh, I totally missed that what he did there.
     
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
  9. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    SOFe likes this.
  10. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Pls edit for me :p
     
    SalmonDE likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.