Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed old update script and made another one new

	deleted:    .openshift/cron/hourly/update_db
	Deleted script that called the old update script

	new file:   .openshift/cron/hourly/update_rpm_list.sh
	This script updates the RPM list daily

	new file:   .openshift/cron/minutely/update_oldest_rpm.sh
	This script updates the oldest RPM minutely

	modified:   app/models/rpm_importer.rb
	Added an exeption catcher in the new import_oldest(number) method.
  • Loading branch information...
commit 25a6f0909e1fe970b8221591114f6809b5637437 1 parent 9c767ea
nicolassatragno authored
View
3  .openshift/cron/hourly/update_db
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-nohup $OPENSHIFT_REPO_DIR/script/update_db
View
9 .openshift/cron/hourly/update_rpm_list.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+if [ `date +%H` == "02" ]
+then
+ export RAILS_ENV="production"
+ cd $OPENSHIFT_REPO_DIR
+ echo "Starting RPM list update..." > $OPENSHIFT_DATA_DIR/last_update.log
+ rake "database:import_rpms[refresh_list]" >> $OPENSHIFT_DATA_DIR/last_update.log 2>&1
+ echo "RPM list update done!" >> $OPENSHIFT_DATA_DIR/last_update.log
+fi
View
5 .openshift/cron/minutely/update_oldest_rpm.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+cd $OPENSHIFT_REPO_DIR
+export RAILS_ENV="production"
+rake "database:update_oldest_rpms[1]" >> $OPENSHIFT_DATA_DIR/last_update.log 2>&1
View
3  app/models/rpm_importer.rb
@@ -12,7 +12,8 @@ def self.import_oldest(number)
puts "Updating #{f.name} (#{total += 1}/#{rpms.size})..."
f.update_from_source
}
-
+ rescue Exception => ex
+ puts ex.message
end
def self.import_all
Please sign in to comment.
Something went wrong with that request. Please try again.