Giter Site home page Giter Site logo

Job Name - Again about ndscheduler HOT 1 CLOSED

nextdoor avatar nextdoor commented on July 2, 2024
Job Name - Again

from ndscheduler.

Comments (1)

dejaentenduu avatar dejaentenduu commented on July 2, 2024

@nbhoj I added it to the JobBase class in job.pyso that it was available to all of my jobs. First step is to find the ndscheduler folder. Depending on how you downloaded it, it may be adjacent to your other files or it may in your virtual environment folder (assuming you made one). For me ndscheduler is in "venv/lib/python3.6/site-packages/". Once you've found job.py find the "run_job.py" function.

In the run_job function you should see a line of code like:
scheduler = schedule_manager.ScheduleManager.get_instance()

You can get a job and it's name with the following:
job = scheduler.get_job(job_id)
cls.job_name = job.name

Above I made job_name a class attribute. Basically, if you are in another job of your own that is subclassed from JobBase you can get the name of the current job by using self.job_name in that job.

from ndscheduler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.