Skip to content
Snippets Groups Projects
Commit b8cc8312 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Home: add a cache to home feed

[enh] No more include feed into release artifact, but load it feed from repo (/doc/feed/)
parent 1d4bc678
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,8 @@
},
"feed": {
"jsonFeed": {
"fr-FR": "https://g1.duniter.fr/feed-fr.json",
"en": "https://g1.duniter.fr/feed-en.json"
"fr-FR": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-fr.json",
"en": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-en.json"
},
"maxContentLength": 650
},
......@@ -117,8 +117,8 @@
},
"feed": {
"jsonFeed": {
"fr-FR": "https://g1.duniter.fr/feed-fr.json",
"en": "https://g1.duniter.fr/feed-en.json"
"fr-FR": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-fr.json",
"en": "https://raw.githubusercontent.com/duniter/cesium/master/doc/feed/feed-en.json"
},
"maxContentLength": 650
},
......
File moved
......@@ -342,10 +342,14 @@ function webCopyFiles() {
gulp.src('./www/img/**/*.*')
.pipe(gulp.dest(tmpPath + '/img')),
// Copy manifest.json, feed.json
gulp.src(['./www/manifest.json', './www/feed*.json'])
// Copy manifest.json
gulp.src('./www/manifest.json')
.pipe(gulp.dest(tmpPath)),
// Copy feed*.json
//gulp.src('./www/feed*.json')
// .pipe(gulp.dest(tmpPath)),
// Copy lib
gulp.src('./www/lib/**/*.*')
.pipe(gulp.dest(tmpPath + '/lib')),
......
......@@ -173,7 +173,7 @@ fi
echo "----------------------------------"
echo "- Building desktop artifacts..."
echo "----------------------------------"
. ${PROJECT_DIR}/scripts/release-desktop.sh $1 ''"$description"''
. ${PROJECT_DIR}/scripts/release-desktop.sh $1
if [[ $? -ne 0 ]]; then
exit 1
fi
......@@ -184,7 +184,7 @@ nvm use ${NODEJS_VERSION}
echo "----------------------------------"
echo "- Push git android project..."
echo "----------------------------------"
. ${PROJECT_DIR}/scripts/release-android-sources.sh $2 ''"$description"''
. ${PROJECT_DIR}/scripts/release-android-sources.sh $2
echo "**********************************"
echo "* Build release succeed !"
......
......@@ -38,8 +38,8 @@ angular.module("cesium.config", [])
},
"feed": {
"jsonFeed": {
"fr-FR": "https://g1.duniter.fr/feed-fr.json",
"en": "https://g1.duniter.fr/feed-en.json"
"fr-FR": "https://raw.githubusercontent.com/duniter/cesium/master/www/feed-fr.json",
"en": "https://raw.githubusercontent.com/duniter/cesium/master/www/feed-en.json"
},
"maxContentLength": 650
},
......@@ -102,4 +102,4 @@ angular.module("cesium.config", [])
"newIssueUrl": "https://git.duniter.org/clients/cesium-grp/cesium/issues/new"
})
;
\ No newline at end of file
;
......@@ -511,7 +511,8 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $
}
function HomeController($scope, $state, $timeout, $ionicHistory, $translate, $http, UIUtils, csConfig, csPlatform, csCurrency, csSettings) {
function HomeController($scope, $state, $timeout, $ionicHistory, $translate, $http, UIUtils,
csConfig, csCache, csPlatform, csCurrency, csSettings) {
'ngInject';
$scope.loading = true;
......@@ -574,7 +575,7 @@ function HomeController($scope, $state, $timeout, $ionicHistory, $translate, $ht
var now = Date.now();
console.debug("[home] Loading feeds from {0}...".format(feedUrl));
$http.get(feedUrl, {responseType: 'json'})
$http.get(feedUrl, {responseType: 'json', cache: csCache.get(null, csCache.constants.LONG)})
.success(function(feed) {
console.debug('[home] Feeds loaded in {0}ms'.format(Date.now()-now));
if (!feed || !feed.items || !feed.items.length) return // skip if empty
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment