我正在尝试读取配置文件以检索“play.ws.timeout.request”。为此,我有这行代码:import { Friend } from './friend.model';
import { Observable } from 'rxjs/Rx';
import { FriendsService } from './friends.service';
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
friends: Observable<Friend[]>;
constructor(private friendService: FriendsService) {}
ngOnInit() {
this.friends = this.friendService.getFriends();
}
...
在我的application.conf中,我有Integer timeout = Play.application().configuration().getInt("play.ws.timeout.request");
我的问题是,它总是返回5000,无论我在配置文件中有什么(如截图所示)。我甚至添加了一个新的配置参数,以确保它读取正确的文件。
有关为何或如何解决此问题的任何想法?感谢
答案 0 :(得分:0)
在我宣布超时之后,还有另一个库有配置文件(包含在我的主要配置文件中)。并且该配置文件会覆盖数据。