Skip to content

Commit

Permalink
0.7 + migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed May 26, 2015
1 parent b64e391 commit 10b8eaf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion airflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.6.0"
__version__ = "0.7.0"

'''
Authentication is implemented using flask_login and different environments can
Expand Down
14 changes: 7 additions & 7 deletions airflow/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def pool_full(self, session=None):
task to run
"""
if not self.task.pool:
return True
return False

close_session = False
if not session:
Expand All @@ -641,25 +641,25 @@ def pool_full(self, session=None):

running = (
session
.query(func.count('*'))
.select_from(TaskInstance)
.query(TaskInstance)
.filter(TaskInstance.pool == self.task.pool)
.filter(TaskInstance.state == State.RUNNING)
.scalar()
.count()
)
pool_size = (
pool = (
session
.query(Pool)
.filter(Pool.pool == self.task.pool)
.first()
)
if not pool_size:
if not pool:
return False

if close_session:
session.expunge_all()
session.commit()
session.close()
return running < pool_size
return running >= pool.slots


def run(
Expand Down
5 changes: 5 additions & 0 deletions migrations.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// To 0.7
alter table task_instance add column queue varchar(50) NULL;
alter table task_instance add column pool varchar(50) NULL;
alter table task_instance add column priority_weight INT NULL;
create index ti_pool on task_instance (pool, state) using btree;
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

# Kept manually in sync with airflow.__version__
version = '0.6.0'
version = '0.7.0'

doc = [
'sphinx>=1.2.3',
Expand Down

0 comments on commit 10b8eaf

Please sign in to comment.