1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

[bug] SubscriptionExpireWorker cannot run due to wrong expiration column in SQL query

This commit is contained in:
Sylvain 2019-07-10 10:52:29 +02:00
parent 79272d9e39
commit ca61e4e08e
4 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@
- Fix a bug: projects RSS feed fails to render
- Fix a bug: abuses reports are not notified to admins
- Fix a bug: SubscriptionExpireWorker cannot run due to wrong expiration column in SQL query
- Updated user's manual for v4 (fr)
- Optimized Dockerfile to speed up build time

View File

@ -2,7 +2,7 @@ class SubscriptionExpireWorker
include Sidekiq::Worker
def perform(expire_in)
Subscription.where('expired_at >= ?', Time.now.at_beginning_of_day).each do |s|
Subscription.where('expiration_date >= ?', Time.now.at_beginning_of_day).each do |s|
if (s.expired_at - expire_in.days).to_date == Time.now.to_date
if expire_in != 0
NotificationCenter.call type: 'notify_member_subscription_will_expire_in_7_days',

View File

@ -4,7 +4,7 @@ class ChangeStartAtToExpiredAtFromSubscription < ActiveRecord::Migration
add_column :subscriptions, :expired_at, :datetime
Subscription.all.each do |s|
if s.respond_to? :expired_at and !s.expired_at?
if s.respond_to? :expired_at && !s.expired_at?
if s.plan.interval == 'month'
s.update_columns(expired_at: s.created_at + 1.month)
else

View File

@ -31,7 +31,7 @@ tar cvzf fabmanager_production_$(date -I).tar.gz fabmanager_production_$(date -I
If you're connected to your server thought SSH, you can download the resulting dump file using the following:
```bash
scp root@remote.server.fab:/apps/fabmanager/postgresql/dump/fabmanager_production_$(date -I).tar.gz .
scp root@remote.server.fab:/apps/fabmanager/postgresql/fabmanager_production_$(date -I).tar.gz .
```
Restore the dump with the following: