Skip to content

为什么.env文件的变量修改了,程序启动时加载的值还是原来的 #91

@aohanhe

Description

@aohanhe

我今天发现一个问题,当我的.env文件修改了之后,使用dotenv!加载的值还是修改前的值。反复启动几次都是这样。请问它是在那里缓存了?还是我的用法不对。
ServerConfig { port: (dotenv!("SERVERPORT") as &str) .to_string() .parse::<u16>() .unwrap(), }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions