Celery never retries your tasks, unless you tell it to. Here is how you can tell her to:

The Basics

There are a few basic terms and procedures that you need to know about Celery, to understand this article. All of them can be found here:

Celery: A few gotchas explained

All available settings

Here is a list of everything you can set and unset to change the retry-behavior of Celery.

All the retry-related settings:

  • default_retry_delay : the number of seconds to wait before the next retry.
  • max_retries : the number of times to retry, the default is 3. If this is set to 5, then the task will run up to 6 times: the first time + 5 retries. …

Image for post
Image for post

Have you ever heard of the continuum of theory-before-practice VS. practice-before-theory? Probably not, since I created the name just now 😏. But, though the name is new, the continuum is old. The question is simple: should I first study, study, study the documentation and then only after I presumably fully understand the library and its logic start using it in my code, or should I first dive into it, use it and abuse it before going back and reading the documentation of it.


You will never be able to accurately estimate the time and effort it will take you to build a piece of software .. for as long as you keep doing new things. As long as your projects don’t resemble each other as your signatures do, you will not know how much effort it will take to finish a new project. A lot has been said and written about software estimation, but one thing is clear: predictions of future effort are always based on the amounts of past effort.

Image for post
Image for post

2 distinct approaches exist for measuring the future time and effort of software…


“If my time is 16:44, what is that in UTC time?”

“Do we use UTC dates or do we store timezones into the database? And by the way, if I call datetime.now(), am I getting the correct time or should I adjust it with a timezone suffix?".

This time-business is so delicate.

Image for post
Image for post
Photo by La Victorie on Unsplash

I never had much trouble with date-times, until last week, when I had to create a humble Celery task that needs to be a master of time, that needs to understand how all the dates on all these objects relate to one another. And suddenly I am finding myself appalled by all datetimes with no timezone info. What a grievous mistake it was to allow programmers to forget about timezones, to just call now() and hope for the best. …


I always wanted to have this. The cool part of me, of course, wanted me to be the one who writes it, the pragmatic part just wanted to have access to a list like this and the hedonic part of me made me ignore the whole topic by telling me to chase after greater pleasures of life, at least greater than this blog post, no matter how magnificent it might maybe become, could ever be. …


Nginx is “a web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache”. uWSGI is an implementation of the WSGI spec, which describes how a web server should communicate with a web app, which makes uWSGI also a type of web server. So, why does a typical server setup for a Python app consists of 2 web servers?

Can I ditch uWSGI?

Given the fact that Nginx is the 2nd most popular web server (right after Apache) and uWSGI’s website does an absolutely horrible job at explaining what uWSGI is or what it provides, I feel inclined to ditching uWSGI. …


Considerations for building a great team

Image for post
Image for post

The first person to walk on the moon was Neil Armstrong. I knew this before I learned how to speak English or knew how to spell his name. Why did the 8-year-old me know this? Why do we need a front man for everything? And how do you build a team in this culture?

Are You a Team Player?

Have you ever been asked this question? Did you notice that etiquette rules determine how to answer it?

We are not supposed to wing it — we are supposed to know the answer by heart. You first firmly say “yes” and then add a vague, but believable proof of your ability to perform exceptionally inside a team. A million articles on the internet explain how to answer in a sophisticated, educated way, without revealing anything personal. …


A short, but sweet .vimrc file

Image for post
Image for post

When did you first learn about Vim? Were you one of those unfortunate souls, who just wanted to run a git command, but ended up trapped in vim? Many of us have been there. Ending up in vim accidentally is like being accidentally teleported to an unknown planet. How are you supposed to google your way out if you do not know where you even are?

I’m still not sure, is vim something everybody knows and uses or maybe just “knows and not-uses” or is it actually really obscure. I only started using it, when I took a deep dive into git commands. Once you start using it, you suddenly realize that GUIs might be overrated. …


Or is it the other way around?

Image for post
Image for post

Today, I came to two realizations, both of them surprising and both of them essential. During an innocuous debate about code review, I suddenly discovered that only a few basic ideas underlie all of my coding-related decisions. One of them is: Simple is better than complex. And about three seconds later, I realized that this is neither a well-known mantra nor one that can be quickly explained. It’s a conviction that you grow into. But without having to wait for a few years, how do I explain it to my teammate?

To me, “simplicity over complexity” is a pragmatic answer to questions of many flavors, a simple Occam’s razor. …


How reading other people’s code shaped my style

Image for post
Image for post

Code readability is a hot topic. We do not agree on what it looks like and we do not agree on how much of it is needed. It is rarely discussed on a new project and practically never on a project with only 1 developer.

The obvious advantage of striving for readability is to have code, which is easier to share between developers and which is easier to maintain, expand, correct and modify later on.

Consequently, if you hope for your project to be long-lived or if you hope for it to grow with plenty of new features, there are benefits to be gained. If your code is easy to read and understand, then new developers can be onboarded quicker and will be valuable sooner. Arguable, they will also make fewer bugs, because it is far easier to make a mistake when dealing with code, which you barely understand than in straightforward code. …

About

Ines Panker

Software Developer by profession, Explorer by mind. The more I know, the more I understand. http://www.ines-panker.com/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store