Skip to content

Commit

Permalink
SCALRCORE-25260 Bringing CI/CD back to life (backports from celery:ma…
Browse files Browse the repository at this point in the history
…in, comment some stuff)
  • Loading branch information
Kludex authored and Marat Komarov committed Feb 7, 2023
1 parent bc95306 commit 5364ad9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 28 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/lint_python.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Linter

on: [pull_request]

jobs:
linter:
runs-on: ubuntu-latest
steps:

- name: Checkout branch
uses: actions/checkout@v3

- name: Run pre-commit
uses: pre-commit/[email protected]
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ name: Celery

on:
push:
branches: [ 'master']
branches: [ 'master', '5.2']
paths:
- '**.py'
- '**.txt'
- '.github/workflows/python-package.yml'
- '**.toml'
pull_request:
branches: [ 'master']
branches: [ 'master', '5.2']
paths:
- '**.py'
- '**.txt'
Expand Down
7 changes: 1 addition & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ repos:
hooks:
- id: flake8

- repo: https://github.com/asottile/yesqa
rev: v1.3.0
hooks:
- id: yesqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
Expand All @@ -24,6 +19,6 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
8 changes: 5 additions & 3 deletions celery/worker/consumer/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
from collections import defaultdict
from time import sleep

import amqp.exceptions
from billiard.common import restart_state
from billiard.exceptions import RestartFreqExceeded
from kombu.asynchronous.semaphore import DummyLock
from kombu.exceptions import ContentDisallowed, DecodeError
from kombu.utils.compat import _detect_environment
from kombu.utils.encoding import safe_repr
from kombu.utils.limits import TokenBucket
import amqp.exceptions
from vine import ppartial, promise

from celery import bootsteps, signals
Expand Down Expand Up @@ -443,8 +443,10 @@ def connect(self):
# Install timer to send heartbeats on gevent
if self.gevent_env and self.amqheartbeat:
hbtick = conn.heartbeat_check
logger.debug('Registring heartbeat timer for connection: {}'.format(id(conn)))
self.timer.call_repeatedly(int(self.amqheartbeat / self.amqheartbeat_rate), hbtick, (self.amqheartbeat_rate,))
logger.debug(f'Registring heartbeat timer for connection: {id(conn)}')
self.timer.call_repeatedly(
int(self.amqheartbeat / self.amqheartbeat_rate), hbtick, (self.amqheartbeat_rate,)
)

return conn

Expand Down

0 comments on commit 5364ad9

Please sign in to comment.